PnP#

class deepinv.optim.PnP(denoiser, *args, **kwargs)[source]#

Bases: Prior

Plug-and-play prior \(\operatorname{prox}_{\gamma \regname}(x) = \operatorname{D}_{\sigma}(x)\).

Parameters:

denoiser (callable) – Denoiser \(\operatorname{D}_{\sigma}\).

prox(x, sigma_denoiser, *args, **kwargs)[source]#

Uses denoising as the proximity operator of the PnP prior \(\regname\) at \(x\).

Parameters:
  • x (torch.Tensor) – Variable \(x\) at which the proximity operator is computed.

  • sigma_denoiser (float) – noise level parameter of the denoiser.

Returns:

(torch.tensor) proximity operator at \(x\).

Examples using PnP:#

Saving and loading models

Saving and loading models

Random phase retrieval and reconstruction methods.

Random phase retrieval and reconstruction methods.

Vanilla PnP for computed tomography (CT).

Vanilla PnP for computed tomography (CT).

DPIR method for PnP image deblurring.

DPIR method for PnP image deblurring.

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

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

Vanilla Unfolded algorithm for super-resolution

Vanilla Unfolded algorithm for super-resolution

Deep Equilibrium (DEQ) algorithms for image deblurring

Deep Equilibrium (DEQ) algorithms for image deblurring

Unfolded Chambolle-Pock for constrained image inpainting

Unfolded Chambolle-Pock for constrained image inpainting