Prior

class deepinv.optim.Prior(g=None)[source]

Bases: Potential

Prior term \(\reg{x}\).

This is the base class for the prior term \(\reg{x}\). As a child class from the Poential class, it comes with methods for computing \(\operatorname{prox}_{g}\) and \(\nabla \regname\). To implement a custom prior, for an explicit prior, overwrite \(\regname\) (do not forget to specify self.explicit_prior = True)

This base class is also used to implement implicit priors. For instance, in PnP methods, the method computing the proximity operator is overwritten by a method performing denoising. For an implicit prior, overwrite grad or prox.

Note

The methods for computing the proximity operator and the gradient of the prior rely on automatic differentiation. These methods should not be used when the prior is not differentiable, although they will not raise an error.

Parameters:

g (callable) – Prior function \(g(x)\).

Examples using Prior:

Radio interferometric imaging with deepinverse

Radio interferometric imaging with deepinverse

Image deblurring with custom deep explicit prior.

Image deblurring with custom deep explicit prior.

Saving and loading models

Saving and loading models

Random phase retrieval and reconstruction methods.

Random phase retrieval and reconstruction methods.

Image deblurring with Total-Variation (TV) prior

Image deblurring with Total-Variation (TV) prior

Image inpainting with wavelet prior

Image inpainting with wavelet prior

Patch priors for limited-angle computed tomography

Patch priors for limited-angle computed tomography

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

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

Vanilla PnP for computed tomography (CT).

Vanilla PnP for computed tomography (CT).

DPIR method for PnP image deblurring.

DPIR method for PnP image deblurring.

Regularization by Denoising (RED) for Super-Resolution.

Regularization by Denoising (RED) for Super-Resolution.

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

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

Uncertainty quantification with PnP-ULA.

Uncertainty quantification with PnP-ULA.

Building your custom sampling algorithm.

Building your custom sampling algorithm.

Learned Iterative Soft-Thresholding Algorithm (LISTA) for compressed sensing

Learned Iterative Soft-Thresholding Algorithm (LISTA) for compressed sensing

Vanilla Unfolded algorithm for super-resolution

Vanilla Unfolded algorithm for super-resolution

Learned iterative custom prior

Learned iterative custom prior

Deep Equilibrium (DEQ) algorithms for image deblurring

Deep Equilibrium (DEQ) algorithms for image deblurring

Learned Primal-Dual algorithm for CT scan.

Learned Primal-Dual algorithm for CT scan.

Unfolded Chambolle-Pock for constrained image inpainting

Unfolded Chambolle-Pock for constrained image inpainting