spyrit.core.meas.Linear.forward

Linear.forward(x: tensor) tensor[source]

Applies linear transform to incoming images: \(y = Hx\).

This is equivalent to computing \(x \cdot H^T\).

Args:

\(x\) (torch.tensor): Batch of vectorized (flattened) images. If x has more than 1 dimension, the linear measurement is applied to each image in the batch.

Shape:

\(x\): \((*, N)\) where * denotes the batch size and N the total number of pixels in the image.

Output: \((*, M)\) where * denotes the batch size and M the number of measurements.

Example:
>>> H = torch.randn([400, 1600])
>>> meas_op = Linear(H)
>>> x = torch.randn([10, 1600])
>>> y = meas_op(x)
>>> print(y.shape)
torch.Size([10, 400])