Denoiser#
- class deepinv.models.Denoiser(device='cpu')[source]#
Bases:
ModuleBase class for denoiser models.
Provides a template for defining denoiser models.
While most denoisers \(\denoisername\) are designed to handle Gaussian noise with variance \(\sigma^2\), this is not mandatory.
Note
A Denoiser can be converted into a
Reconstructorby using thedeepinv.models.ArtifactRemovalclass.The base class inherits from
torch.nn.Module.- forward(x, sigma, **kwargs)[source]#
Applies denoiser \(\denoiser{x}{\sigma}\). The input
xis expected to be with pixel values in[0, 1]range, up to random noise. The output is also expected to be in[0, 1]range.- Parameters:
x (torch.Tensor) – noisy input, of shape
[B, C, H, W].sigma (torch.Tensor, float) – noise level. Can be a
floator atorch.Tensorof shape[B]. If a singlefloatis provided, the same noise level is used for all samples in the batch. Otherwise, batch-wise noise levels are used.
- Returns:
(
torch.Tensor) Denoised tensor.
Examples using Denoiser:#
Imaging inverse problems with adversarial networks
Random phase retrieval and reconstruction methods.
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.
Using state-of-the-art diffusion models from HuggingFace Diffusers with DeepInverse
Building your diffusion posterior sampling method using SDEs
Self-supervised learning from incomplete measurements of multiple operators.
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
Unfolded Chambolle-Pock for constrained image inpainting