NoiseModel#
- class deepinv.physics.NoiseModel(noise_model: Callable | None = None, rng: Generator | None = None)[source]#
Bases:
Module
Base class for noise model. NoiseModel can be combined via
deepinv.physics.noise.NoiseModel.__mul__()
,- Parameters:
rng (torch.Generator (Optional)) – a pseudorandom random number generator for the parameter generation. If is 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.noise.NoiseModel) – Physics operator \(A_2\)
- Returns:
(deepinv.physics.noise.NoiseModel) concatenated operator
- forward(input: Tensor, seed: int | None = None) Tensor [source]#
Add noise to the input :param torch.Tensor input: input tensor :param int seed: the seed for the random number generator.
- rand_like(input: Tensor, seed: int | None = None)[source]#
Equivalent to torch.rand_like but supports a pseudorandom number generator argument. :param int seed: the seed for the random number generator, if rng is provided.
- randn_like(input: Tensor, seed: int | None = None)[source]#
Equivalent to torch.randn_like but supports a pseudorandom number generator argument. :param int seed: the seed for the random number generator, if rng is provided.
- rng_manual_seed(seed: int | None = 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: it will be ignored if the random number generator is not initialized.
Examples using NoiseModel
:#
Reconstructing an image using the deep image prior.
Image transforms for equivariance & augmentations
A tour of forward sensing operators
Image deblurring with custom deep explicit prior.
Image deblurring with Total-Variation (TV) prior
Image inpainting with wavelet prior
Plug-and-Play algorithm with Mirror Descent for Poisson noise inverse problems.
Vanilla PnP for computed tomography (CT).
DPIR method for PnP image deblurring.
Regularization by Denoising (RED) for Super-Resolution.
PnP with custom optimization algorithm (Condat-Vu Primal-Dual)
Uncertainty quantification with PnP-ULA.
Image reconstruction with a diffusion model
Building your custom sampling algorithm.
Vanilla Unfolded algorithm for super-resolution
Deep Equilibrium (DEQ) algorithms for image deblurring
Learned Primal-Dual algorithm for CT scan.
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 UNSURE loss.
Self-supervised denoising with the SURE loss.
Self-supervised denoising with the Neighbor2Neighbor loss.
Self-supervised denoising with the Generalized R2R loss.