spyrit.core.noise.PoissonGaussian

class spyrit.core.noise.PoissonGaussian(alpha: float = 1.0, sigma: float = 1.0, mu: float = 0.0, g: float = 1.0)[source]

Bases: Module

Simulate measurements corrupted by Poisson noise

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

where \(g\) is a gain, \(\mathcal{P}\) is the Poisson distribution, \(\alpha\) represents the intensity of the noiseless measurements \(z\), and \(\mathcal{N}(\mu, \sigma^2)\) represents a Gaussian distribution of mean value \(\mu\) and variance \(\sigma^2\).

The class is constructed from the gain \(g\), the intensity \(\alpha\), the dark current \(\mu\), and the dark noise \(\sigma\).

Args:

alpha (float): Intensity \(\alpha\). Defaults to 1.

sigma (float): Dark noise \(\sigma\). Defaults to 1.

mu (float): Dark current \(\mu\). Defaults to 0.

g (float): Gain \(g\). Defaults to 1.

Attributes:

alpha (float): Intensity \(\alpha\).

sigma (float): Dark noise \(\sigma\).

mu (float): Dark current \(\mu\).

g (float): Gain \(g\).

Example:
>>> from spyrit.core.noise import PoissonGaussian
>>> import torch
>>> noise = PoissonGaussian(10.0)
>>> z = torch.tensor([1.0, 3.0, 6.0])
>>> y = noise(z)
>>> print(y)
tensor([...])

Methods

forward(z)

Corrupt measurement by Poisson noise