GaussianNoise#

class deepinv.physics.GaussianNoise(sigma=0.1, rng=None)[source]#

Bases: NoiseModel

Gaussian noise \(y=z+\epsilon\) where \(\epsilon\sim \mathcal{N}(0,I\sigma^2)\).


Examples:

Adding gaussian noise to a physics operator by setting the noise_model attribute of the physics operator:

>>> from deepinv.physics import Denoising, GaussianNoise
>>> import torch
>>> physics = Denoising()
>>> physics.noise_model = GaussianNoise()
>>> x = torch.rand(1, 1, 2, 2)
>>> y = physics(x)
Parameters:
  • sigma (float) – Standard deviation of the noise.

  • rng (torch.Generator) – (optional) a pseudorandom random number generator for the parameter generation.

forward(x, sigma=None, seed=None, **kwargs)[source]#

Adds the noise to measurements x

Parameters:
  • x (torch.Tensor) – measurements

  • sigma (float, torch.Tensor) – standard deviation of the noise. If not None, it will overwrite the current noise level.

  • seed (int) – the seed for the random number generator, if rng is provided.

Returns:

noisy measurements

update_parameters(sigma=None, **kwargs)[source]#

Updates the standard deviation of the noise.

Parameters:

sigma (float, torch.Tensor) – standard deviation of the noise.

Examples using GaussianNoise:#

Image deblurring with custom deep explicit prior.

Image deblurring with custom deep explicit prior.

Creating your own dataset

Creating your own dataset

Reconstructing an image using the deep image prior.

Reconstructing an image using the deep image prior.

Creating a forward operator.

Creating a forward operator.

A tour of forward sensing operators

A tour of forward sensing operators

Image transforms for equivariance & augmentations

Image transforms for equivariance & augmentations

3D wavelet denoising

3D wavelet denoising

Image deblurring with Total-Variation (TV) prior

Image deblurring with Total-Variation (TV) prior

Image inpainting with wavelet prior

Image inpainting with wavelet prior

Expected Patch Log Likelihood (EPLL) for Denoising and Inpainting

Expected Patch Log Likelihood (EPLL) for Denoising and Inpainting

DPIR method for PnP image deblurring.

DPIR method for PnP image deblurring.

PnP with custom optimization algorithm (Condat-Vu Primal-Dual)

PnP with custom optimization algorithm (Condat-Vu Primal-Dual)

Regularization by Denoising (RED) for Super-Resolution.

Regularization by Denoising (RED) for Super-Resolution.

Vanilla PnP for computed tomography (CT).

Vanilla PnP for computed tomography (CT).

Building your custom sampling algorithm.

Building your custom sampling algorithm.

Image reconstruction with a diffusion model

Image reconstruction with a diffusion model

Implementing DiffPIR

Implementing DiffPIR

Uncertainty quantification with PnP-ULA.

Uncertainty quantification with PnP-ULA.

Self-supervised denoising with the Generalized R2R loss.

Self-supervised denoising with the Generalized R2R loss.

Self-supervised learning with measurement splitting

Self-supervised learning with measurement splitting

Self-supervised denoising with the UNSURE loss.

Self-supervised denoising with the UNSURE loss.

Deep Equilibrium (DEQ) algorithms for image deblurring

Deep Equilibrium (DEQ) algorithms for image deblurring

Learned Primal-Dual algorithm for CT scan.

Learned Primal-Dual algorithm for CT scan.

Vanilla Unfolded algorithm for super-resolution

Vanilla Unfolded algorithm for super-resolution