spyrit.core.meas.FreeformLinear.forward
- FreeformLinear.forward(x: tensor) tensor[source]
Forward pass (measurement + noise) of the measurement operator.
The mask is first applied to the input tensor, then the input tensor goes through the measurement model and the noise model. It is equivalent to the method measure() followed by the noise model
forward()method.- Args:
x (
torch.tensor): A tensor where the dimensions indexed by self.meas_dims match the measurement shape self.meas_shape.- Returns:
torch.tensor: A tensor of shape (*, self.M) where * denotes all the dimensions of the input tensor not included in self.meas_dims.- Example: Measure the upper half of 32x32 images
# >>> H = torch.randn(10, 16*32)