spyrit.core.meas.LinearSplit.forward_H

LinearSplit.forward_H(x: tensor) tensor[source]

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

This is equivalent to computing \(x \cdot H^T\). The input images must be unvectorized.

Warning

This method uses the measurement matrix \(H\) to compute the linear measurements from incoming images. If you want to apply the splitted operator \(P\), use the method forward().

Args:

x (torch.tensor): Batch of images of shape \((*, h, w)\). * can have any number of dimensions, for instance (b, c) where b is the batch size and c the number of channels. h and w are the height and width of the images.

Output:

torch.tensor: The linear measurements of the input images. It has shape \((*, M)\) where * denotes any number of dimensions and M the number of measurements.

Shape:

x: \((*, h, w)\) where * denotes the batch size and h and w are the height and width of the images.

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

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