spyrit.core.prep.SplitPoisson.forward_expe
- SplitPoisson.forward_expe(x: tensor, meas_op: LinearSplit | HadamSplit) Tuple[tensor, tensor][source]
Preprocess to compensate for image normalization and splitting of the measurement operator.
It computes \(m = \frac{x[0::2]-x[1::2]}{\alpha}\), where \(\alpha = \max H^\dagger (x[0::2]-x[1::2])\).
Contrary to
forward(), the image intensity \(\alpha\) is estimated from the pseudoinverse of the unsplit measurements. This method is typically called for the reconstruction of experimental measurements, whileforward()is called in simulations.The method returns a tuple containing both \(m\) and \(\alpha\)
- Args:
x: batch of measurement vectorsmeas_op: measurement operator (required to estimate \(\alpha\))Output (\(m\), \(\alpha\)): preprocess measurement and estimated intensities.
- Shape:
x: \((B, 2M)\) where \(B\) is the batch dimension
meas_op: the number of measurements
meas_op.Mshould match \(M\).\(m\): \((B, M)\)
\(\alpha\): \((B)\)
- Example:
>>> 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, alpha = split_op.forward_expe(x, meas_op) >>> print(m.shape) >>> print(alpha.shape) torch.Size([10, 400]) torch.Size([10])