spyrit.core.meas.HadamSplit.inverse

HadamSplit.inverse(y: tensor) tensor[source]

Inverse transform of Hadamard-domain images.

It can be described as \(x = H_{had}^{-1}G y\), where \(y\) is the input Hadamard-domain measurements, \(H_{had}^{-1}\) is the inverse Hadamard transform, and \(G\) is the reordering matrix.

Note

For this inverse to work, the input vector must have the same number of measurements as there are pixels in the original image (\(M = N\)), i.e. no subsampling is allowed.

Warning

This method is deprecated and will be removed in a future version. Use self.pinv instead.

Args:

\(y\): batch of images in the Hadamard domain of shape \((*,c,M)\). * denotes any size, c the number of channels, and M the number of measurements (with M = N).

Output:

\(x\): batch of images of shape \((*,c,h,w)\). * denotes any size, c the number of channels, and h, w the height and width of the image (with h times w = N = M).

Shape:

\(y\): \((*, c, M)\) with \(*\) any size, \(c\) the number of channels, and \(N\) the number of measurements (with M = N).

Output: math:(*, c, h, w) with \(h\) and \(w\) the height and width of the image.

Example:
>>> h = 32
>>> Ord = torch.randn(h, h)
>>> meas_op = HadamSplit(400, h, Ord)
>>> y = torch.randn(10, h**2)
>>> x = meas_op.inverse(y)
>>> print(x.shape)
torch.Size([10, 32, 32])