PoissonGaussianNoise#
- class deepinv.physics.PoissonGaussianNoise(gain=1.0, sigma=0.1, rng: Generator | None = None)[source]#
Bases:
NoiseModel
Poisson-Gaussian noise \(y = \gamma z + \epsilon\) where \(z\sim\mathcal{P}(\frac{x}{\gamma})\) and \(\epsilon\sim\mathcal{N}(0, I \sigma^2)\).
- Examples:
Adding Poisson gaussian noise to a physics operator by setting the
noise_model
attribute of the physics operator:>>> from deepinv.physics import Denoising, PoissonGaussianNoise >>> import torch >>> physics = Denoising() >>> physics.noise_model = PoissonGaussianNoise() >>> x = torch.rand(1, 1, 2, 2) >>> y = physics(x)
- Parameters:
gain (float) – gain of the noise.
sigma (float) – Standard deviation of the noise.
rng (torch.Generator (Optional)) – a pseudorandom random number generator for the parameter generation.
- forward(x, gain=None, sigma=None, seed: int | None = None, **kwargs)[source]#
Adds the noise to measurements x
- Parameters:
x (torch.Tensor) – measurements
gain (None, float, torch.Tensor) – gain of the noise. If not None, it will overwrite the current gain.
sigma (None, float, torch.Tensor) – Tensor containing gain and standard deviation. If not None, it will overwrite the current gain and standard deviation.
seed (int) – the seed for the random number generator, if rng is provided.
- Returns:
noisy measurements
- update_parameters(gain=None, sigma=None, **kwargs)[source]#
Updates the gain and standard deviation of the noise.
- Parameters:
gain (float, torch.Tensor) – gain of the noise.
sigma (float, torch.Tensor) – standard deviation of the noise.
Examples using PoissonGaussianNoise
:#
A tour of forward sensing operators