spyrit.core.prep.SplitPoisson.forward
- SplitPoisson.forward(x: tensor) tensor[source]
Preprocess to compensates for image normalization and splitting of the measurement operator.
It computes \(\frac{x[0::2]-x[1::2]}{\alpha} - H1\)
- Args:
x: batch of measurement vectors- Shape:
x: \((*, 2M)\) where \(*\) indicates one or more dimensions
meas_op: the number of measurements
meas_op.Mshould match \(M\).Output: \((*, M)\)
- Example:
>>> x = torch.rand([10,2*400], dtype=torch.float) >>> H = torch.rand([400,32*32]) >>> meas_op = LinearSplit(H) >>> split_op = SplitPoisson(10, meas_op) >>> m = split_op(x) >>> print(m.shape) torch.Size([10, 400])
- Example 2:
>>> x = torch.rand([10,2*400], dtype=torch.float) >>> Perm = torch.rand([32,32]) >>> meas_op = HadamSplit(400, 32, Perm) >>> split_op = SplitPoisson(10, meas_op) >>> m = split_op(x) >>> print(m.shape) torch.Size([10, 400])