DPSDataFidelity#
- class deepinv.sampling.DPSDataFidelity(denoiser=None)[source]#
Bases:
NoisyDataFidelity
The DPS data-fidelity term.
This corresponds to the
prior as proposed in Diffusion Probabilistic Models.- Parameters:
denoiser (deepinv.models.Denoiser) – Denoiser network.
Note
The preconditioning term is computed with automatic differentiation.
- Parameters:
denoiser (deepinv.models.Denoiser) – Denoiser network
- forward(x, y, physics, sigma, clip=False)[source]#
Returns the loss term
.- Parameters:
x (torch.Tensor) – input image
y (torch.Tensor) – measurements
physics (deepinv.physics.Physics) – forward operator
sigma (float) – standard deviation of the noise.
clip (bool) – whether to clip the output of the denoiser to the range [-1, 1].
- Returns:
(torch.Tensor) loss term.
- Return type:
- grad(x, y, physics, sigma, *args, **kwargs)[source]#
- Parameters:
x (torch.Tensor) – Current iterate.
y (torch.Tensor) – Input data.
physics (deepinv.physics.Physics) – physics model
sigma (float) – Standard deviation of the noise.
- Returns:
(
torch.Tensor
) score term.- Return type:
Examples using DPSDataFidelity
:#

Posterior Sampling for Inverse Problems with Stochastic Differential Equations modeling.