spyrit.core.meas.HadamSplit.forward_H

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

Optimized measurement simulation for Hadamard patterns, using the Fast Hadamard Transform.

The 2D fast Walsh-ordered Walsh-Hadamard transform is applied to the incoming linearized data \(x\). The linearized data is reshaped to a 2D image before the 2D transform, and is then reshaped to a linear vector before it is returned.

Args:

\(x\) (torch.tensor): Batch of vectorized (flattened) images. If x has more than 1 dimension, the linear measurement is applied to the last dimension 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.