spyrit.core.meas.DynamicHadamSplit.forward

DynamicHadamSplit.forward(x: tensor) tensor

Simulates the measurement of a motion picture \(y = P \cdot x(t)\).

The output \(y\) is computed as \(y = Px\), where \(P\) is the measurement matrix and \(x\) is a batch of vectorized (flattened) images.

The matrix \(P\) contains only positive values and is obtained by splitting a measurement matrix \(H\) such that \(P\) has a shape of \((2M, N)\) and P[0::2, :] = H_{+} and P[1::2, :] = H_{-}, where \(H_{+} = \max(0,H)\) and \(H_{-} = \max(0,-H)\).

Args:

x: Batch of vectorized (flattened) images of shape \((*, 2M, N)\) where * denotes the batch size, \(2M\) the number of measurements in the measurement matrix \(P\) and \(N\) the number of pixels in the image.

Shape:

\(x\): \((*, 2M, N)\)

\(P\) has a shape of \((2M, N)\) where \(M\) is the number of measurements as defined by the first dimension of \(H\) and \(N\) is the number of pixels in the image.

\(output\): \((*, 2M)\)

Example:
>>> x = torch.rand([10, 800, 1600])
>>> H = torch.rand([400, 1600])
>>> meas_op = DynamicLinearSplit(H)
>>> y = meas_op(x)
>>> print(y.shape)
torch.Size([10, 800])