spyrit.core.prep.SplitPoissonRaw.forward_expe
- SplitPoissonRaw.forward_expe(x: tensor, meas_op: LinearSplit | HadamSplit, dim=-1) Tuple[tensor, tensor][source]
Preprocess to compensate for image normalization and splitting of the measurement operator.
Note
Contrary to
forward(), the image intensity \(\alpha\) is estimated from the raw measurements. This method is typically called for the reconstruction of experimental measurements, whileforward()is called in simulations.- Args:
x: batch of measurement vectors with shape \((*, 2M)\)meas_op: measurement operator (seemeas). The number of measurementsmeas_op.Mshould be equal to \(M\).dim: dimensions where the max of the pseudo inverse is computed. Defaults to -1 (i.e., last dimension).- Output:
Preprocessed measurements \(m\) with shape \((*, M)\).
Estimated intensities \(\alpha\) with shape \((*)\).
- Example:
>>> H = torch.rand([400,32*32]) >>> meas = LinearSplit(H) >>> split = SplitPoissonRaw(10, meas_op) >>> x = torch.rand([10,2*400], dtype=torch.float) >>> split.set_expe() >>> m, alpha = split.forward_expe(x, meas) >>> print(m.shape) >>> print(alpha.shape) torch.Size([10, 400]) torch.Size([1])