spyrit.core.noise.PoissonApproxGaussSameNoise
- class spyrit.core.noise.PoissonApproxGaussSameNoise(meas_op: Linear | LinearSplit | HadamSplit, alpha: float)[source]
Bases:
NoNoiseSimulates measurements corrupted by identical Gaussian-approximated Poisson noise.
To accelerate the computation, we consider a Gaussian approximation to the Poisson distribution. Contrary to
PoissonApproxGauss, all measurements in a batch are corrupted with the same noise sample, i.e. the noise depends only on the measurement number (and order).Assuming incoming images \(x\) in the range [-1;1], measurements are first simulated for images in the range [0; \(\alpha\)]: \(y = \frac{\alpha}{2} P(1+x)\). Then, Gaussian noise is added: \(y + \sqrt{y} \cdot \mathcal{G}(\mu=0,\sigma^2=1)\).
The class is constructed from a measurement operator \(P\) and an image intensity \(\alpha\) that controls the noise level.
Warning
Assumes that the incoming images \(x\) are in the range [-1;1]
- Args:
meas_op: Measurement operator \(H\) (see themeassubmodule)alpha(float): Image intensity (in photoelectrons)- Example 1: Using a
Linearmeasurement operator >>> H = torch.rand([400,32*32]) >>> meas_op = Linear(H) >>> noise_op = PoissonApproxGaussSameNoise(meas_op, 10.0)
- Example 2: Using a
HadamSplitoperator >>> Perm = torch.rand([32*32,32*32]) >>> meas_op = HadamSplit(H, Perm, 32, 32) >>> noise_op = PoissonApproxGaussSameNoise(meas_op, 200.0)
Methods
forward(x)Simulates measurements corrupted by Poisson noise
reindex(x[, axis, inverse_permutation])Sorts a tensor along a specified axis using the indices tensor.