NoiseModel#
- class deepinv.physics.NoiseModel(noise_model=None, rng=None)[source]#
Bases:
ModuleBase 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, None) – (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
rngof \(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_likebut supports a pseudorandom number generator argument.- Parameters:
seed (int) – the seed for the random number generator, if
rngis provided.
- randn_like(input, seed=None)[source]#
Equivalent to
torch.randn_likebut supports a pseudorandom number generator argument.- Parameters:
seed (int) – the seed for the random number generator, if
rngis 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:#
Reconstruct real CT sinograms with the 2DeteCT benchmark
Low-dose CT with ASTRA backend and Total-Variation (TV) prior
Reconstruct accelerated non-Cartesian breast MRI acquisition data
Reconstruct prospectively-undersampled raw multicoil MRI
3D denoising of brain MRI with wavelet and TV priors
Reconstructing an image using the deep image prior.
Expected Patch Log Likelihood (EPLL) for Denoising and Inpainting
Patch priors for limited-angle computed tomography
Poisson Inverse Problems with Maximum-Likelihood Expectation-Maximization (MLEM)
Poisson-Gaussian Denoising with the Generalized Anscombe Transform
Pattern Ordering in a Compressive Single Pixel Camera
PnP with custom optimization algorithm (Primal-Dual Condat-Vu)
Plug-and-Play algorithm with Mirror Descent for Poisson noise inverse problems.
Regularization by Denoising (RED) for Super-Resolution.
Using state-of-the-art diffusion models from HuggingFace Diffusers with DeepInverse
Flow-Matching for posterior sampling and unconditional generation
Noisy data-fidelity terms for diffusion posterior sampling
Self-supervised denoising with the Neighbor2Neighbor loss.
Self-supervised denoising with the Generalized R2R loss.
Self-supervised learning with measurement splitting
Deep Equilibrium (DEQ) algorithms for image deblurring
Reducing the memory and computational complexity of unfolded network training