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, while forward() is called in simulations.

Args:

x: batch of measurement vectors with shape \((*, 2M)\)

meas_op: measurement operator (see meas). The number of measurements meas_op.M should 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])