spyrit.core.meas.HadamSplit.forward_H

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

Optimized measurement simulation using the Fast Hadamard Transform.

The 2D fast Walsh-ordered Walsh-Hadamard transform is applied to the incoming images \(x\). This is equivalent to computing \(x \cdot H^T\).

Args:

\(x\) (torch.tensor): Batch of images of shape \((*,h,w)\). * denotes any dimension, 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 any dimension, 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: \((*,M)\) where * denotes denotes any number of dimensions and M the number of measurements.