spyrit.core.noise.PoissonGaussian.forward

PoissonGaussian.forward(z: tensor) tensor[source]

Corrupt measurement by Poisson noise

\[y \sim g \mathcal{P}\left(\alpha z\right) + \mathcal{N}(\mu, \sigma^2), \quad \text{with }z\ge 0\]
Args:

z (torch.tensor): Measurements \(z\) with arbitrary shape.

Returns:

torch.tensor: Noisy measurements \(y\) with the same shape as \(z\).

Example:
>>> import spyrit.core.noise as sn
>>> import torch
>>> noise = sn.Poisson(100)
>>> z = torch.empty(10, 4).uniform_(0, 1)
>>> y = noise(z)
>>> print(y.shape)
torch.Size([10, 4])
>>> print(f"Noiseless measurements in ({torch.min(z):.2f} , {torch.max(z):.2f})")
Noiseless measurements in (...)
>>> print(f"Noisy measurements in ({torch.min(y):.2f} , {torch.max(y):.2f})")
Noisy measurements in (...)