spyrit.core.meas.FreeformLinear
- class spyrit.core.meas.FreeformLinear(H: tensor, meas_shape: int | Size | Iterable[int] = None, meas_dims: int | Size | Iterable[int] = None, index_mask: tensor = None, bool_mask: tensor = None, *, noise_model: bool = None, dtype: dtype = torch.float32, device: device = device(type='cpu'))[source]
Bases:
LinearPerforms linear measurements on a subset (mask) of pixels in the image.
Methods
adjoint(m[, unvectorize])Apply adjoint of matrix H.
apply_mask(x)Appplies the saved mask to the input tensor, where the masked dimensions are collapsed into one.
forward(x)Forward pass (measurement + noise) of the measurement operator.
mask_unvectorize(x[, fill_value])Unflatten the last dimension of a tensor to the measurement shape at the measured dimensions based on the mask.
Flatten a tensor along the measured dimensions, which are collapsed into one.
measure(x)Apply the measurement patterns (no noise) to the incoming tensor.
unvectorize(input)Unflatten the measured dimensions.
vectorize(input)Flatten the measured dimensions.