NoiseModel#
- class deepinv.physics.NoiseModel(noise_model=None, rng=None)[source]#
Bases:
Module
Base class for noise model.
Noise models can be combined via
deepinv.physics.NoiseModel.__mul__()
.- Parameters:
noise_model (Callable) – noise model function \(N(y)\).
rng (torch.Generator) – (optional) a pseudorandom random number generator for the parameter generation. If provided, it should be on the same device as the input.
- __mul__(other)[source]#
Concatenates two noise \(N = N_1 \circ N_2\) via the mul operation
The resulting operator will add the noise from both noise models and keep the
rng
of \(N_1\).- Parameters:
other (deepinv.physics.NoiseModel) – Physics operator \(A_2\)
- Returns:
(deepinv.physics.NoiseModel) concatenated operator
- forward(input, seed=None)[source]#
Add noise to the input
- Parameters:
input (torch.Tensor) – input tensor
seed (int) – the seed for the random number generator.
- rand_like(input, seed=None)[source]#
Equivalent to
torch.rand_like
but supports a pseudorandom number generator argument.- Parameters:
seed (int) – the seed for the random number generator, if
rng
is provided.
- randn_like(input, seed=None)[source]#
Equivalent to
torch.randn_like
but supports a pseudorandom number generator argument.- Parameters:
seed (int) – the seed for the random number generator, if
rng
is provided.
- rng_manual_seed(seed=None)[source]#
Sets the seed for the random number generator.
- Parameters:
seed (int) – the seed to set for the random number generator. If not provided, the current state of the random number generator is used. .. note:: The seed will be ignored if the random number generator is not initialized.
Examples using NoiseModel
:#

Reconstructing an image using the deep image prior.

Plug-and-Play algorithm with Mirror Descent for Poisson noise inverse problems.

Regularization by Denoising (RED) for Super-Resolution.

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

Deep Equilibrium (DEQ) algorithms for image deblurring

Expected Patch Log Likelihood (EPLL) for Denoising and Inpainting

Patch priors for limited-angle computed tomography

Self-supervised learning with measurement splitting

Self-supervised denoising with the Neighbor2Neighbor loss.

Self-supervised denoising with the Generalized R2R loss.