spyrit.core.meas.DynamicLinear.forward

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

Simulates the measurement of a motion picture \(y = H \cdot x(t)\).

The output \(y\) is computed as \(y = Hx\), where \(H\) is the measurement matrix and \(x\) is a batch of vectorized (flattened) images.

Warning

There must be exactly as many images as there are measurements in the linear operator used to initialize the class, i.e. H.shape[-2] == x.shape[-2]

Args:

\(x\): Batch of vectorized (flattened) images.

Shape:

\(x\): \((*, M, N)\), where * denotes the batch size and \((M, N)\) is the shape of the measurement matrix \(H\). \(M\) is the number of measurements (and frames) and \(N\) the number of pixels in the image.

\(output\): \((*, M)\)

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