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 images.

Args:

\(x\): Batch of images of shape \((*, t, c, h, w)\). * denotes any dimension (e.g. the batch size), t the number of frames, c the number of channels, and h, w the height and width of the images.

Output:

\(y\): Linear measurements of the input images. It has shape \((*, c, M)\) where * denotes any number of dimensions, c the number of channels, and M the number of measurements.

Warning

There must be exactly as many images as there are measurements in the linear operator used to initialize the class, i.e. t = M.

Shape:

\(x\): \((*, t, c, h, w)\), where * denotes the batch size, t the number of frames, c the number of channels, and h, w the height and width of the images.

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

Example:

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