UniformGaussianNoise#
- class deepinv.physics.UniformGaussianNoise(sigma_min=0.0, sigma_max=0.5, rng=None)[source]#
Bases:
NoiseModel
Gaussian noise \(y=z+\epsilon\) where \(\epsilon\sim \mathcal{N}(0,I\sigma^2)\) and \(\sigma \sim\mathcal{U}(\sigma_{\text{min}}, \sigma_{\text{max}})\)
- Examples:
Adding uniform gaussian noise to a physics operator by setting the
noise_model
attribute of the physics operator:>>> from deepinv.physics import Denoising, UniformGaussianNoise >>> import torch >>> physics = Denoising() >>> physics.noise_model = UniformGaussianNoise() >>> x = torch.rand(1, 1, 2, 2) >>> y = physics(x)
- Parameters:
sigma_min (float) – minimum standard deviation of the noise.
sigma_max (float) – maximum standard deviation of the noise.
rng (torch.Generator) – (optional) a pseudorandom random number generator for the parameter generation.
- forward(x, seed=None, **kwargs)[source]#
Adds the noise to measurements x.
- Parameters:
x (torch.Tensor) – measurements.
seed (int) – the seed for the random number generator, if
rng
is provided.
- Returns:
noisy measurements.