spyrit.core.recon.PseudoInverse.forward

PseudoInverse.forward(x: tensor, meas_op: Linear | DynamicLinear, **kwargs) tensor[source]

Computes pseudo-inverse of measurements.

Args:

x: Batch of measurement vectors.

meas_op: Measurement operator. Any class that implements a pinv() method can be used, e.g., HadamSplit.

kwargs: Additional keyword arguments that are passed to the pinv() method of the measurement operator. Can be used to specify a regularization parameter.

Shape:

x: \((*, M)\)

meas_op: not applicable

output: \((*, N)\)

Example:
>>> H = torch.rand([400,32*32])
>>> Perm = torch.rand([32*32,32*32])
>>> meas_op =  HadamSplit(H, Perm, 32, 32)
>>> y = torch.rand([85,400], dtype=torch.float)
>>> pinv_op = PseudoInverse()
>>> x = pinv_op(y, meas_op)
>>> print(x.shape)
torch.Size([85, 1024])