spyrit.core.meas.DynamicHadamSplit.forward_H
- DynamicHadamSplit.forward_H(x: tensor) tensor
Simulates the measurement of a motion picture \(y = H \cdot x(t)\).
The output \(y\) is computed as \(y = Hx\), where \(H\) is the measurement matrix and \(x\) is a batch of images.
The matrix \(H\) can contain positive and negative values and is given by the user at initialization. If you want to measure with the splitted matrix \(P\), use the method
forward().- Args:
x: Batch of images of shape \((*, t, c, h, w)\) where * denotes any dimension (e.g. the batch size), \(t\) the number of frames, \(c\) the number of channels, and \(h\), \(w\) the height and width of the images.- Output:
\(y\): Linear measurements of the input images. It has shape \((*, c, M)\) where * denotes any number of dimensions, \(c\) the number of channels, and \(M\) the number of measurements.
Important
There must be as many images as there are measurements in the original linear operator, i.e. \(t = M\).
- Shape:
\(x\): \((*, t, c, h, w)\)
\(H\) has a shape of \((M, N)\) where \(M\) is the number of measurements and \(N\) is the number of pixels in the image.
\(output\): \((*, c, M)\)
- Example:
>>> x = torch.rand([10, 400, 3, 40, 40]) >>> H = torch.rand([400, 1600]) >>> meas_op = LinearDynamicSplit(H) >>> y = meas_op.forward_H(x) >>> print(y.shape) torch.Size([10, 3, 400])