Modulo
- class colibri.optics.modulo.Modulo(threshold=1.0)[source]
Bases:
BaseOpticsLayer
Modulo Sensing Operator
This operator applies the non-linear modulo operation to the input tensor.
Mathematically, this operator can be described as follows:
\[\mathbf{y} = \mathcal{M}_t(\mathbf{x}) = \text{mod}(\mathbf{x}, t)\]where \(\mathbf{x}\in\xset\) is the input optical field, \(\mathbf{y}\in\yset\) is the acquired signal, and \(t\) is the threshold value.
- forward(x, type_calculation='forward')[source]
Forward pass of the modulo operator
- Parameters:
x (torch.Tensor) – Input tensor with shape (B, L, M, N)
type_calculation (str) – Type of calculation to perform. Default: “forward”
- Returns:
Output tensor with shape (B, L, M, N)
- Return type:
torch.Tensor