MoreauYoshidaPrior#
- class cuqi.implicitprior.MoreauYoshidaPrior(prior, smoothing_strength=0.1, **kwargs)#
This class defines (implicit) smoothed priors for which we can apply gradient-based algorithms. The smoothing is performed using the Moreau-Yoshida envelope of the target prior potential.
In the following we give a detailed explanation of the Moreau-Yoshida smoothing.
We consider a density such that - logpi(x) = -g(x) with g convex, lsc, proper but not differentiable. Consequently, we cannot apply any algorithm requiring the gradient of g. Idea: We consider the Moreau envelope of g defined as
g_{smoothing_strength} (x) = inf_z 0.5*| x-z |_2^2/smoothing_strength + g(z).
- g_{smoothing_strength} has some nice properties
g_{smoothing_strength}(x)–>g(x) as smoothing_strength–>0 for all x
- abla g_{smoothing_strength} is 1/smoothing_strength-Lipschitz
abla g_{smoothing_strength}(x) = (x - prox_g^{smoothing_strength}(x))/smoothing_strength for all x with
prox_g^{smoothing_strength}(x) = argmin_z 0.5*| x-z |_2^2/smoothing_strength + g(z) .
Consequently, we can apply any gradient-based algorithm with g_{smoothing_strength} in lieu of g. These algorithms do not require the full knowledge of g_{smoothing_strength} but only its gradient. The gradient of g_{smoothing_strength} is fully determined by prox_g^{smoothing_strength} and smoothing_strength. It is important as, although there exists an explicit formula for g_{smoothing_strength}, it is rarely used in practice, as it would require us to solve an optimization problem each time we want to estimate g_{smoothing_strength}. Furthermore, there exist cases where we dont’t the regularization g with which the mapping prox_g^{smoothing_strength} is associated.
- Remark (Proximal operators are denoisers):
We consider the denoising inverse problem x = u + n, with n sim mathcal{N}(0, smoothing_strength I). A mapping solving a denoising inverse problem is called denoiser. It takes the noisy observation x as an input and returns a less noisy version of x which is an estimate of u. We assume a prior density pi(u) propto exp(- g(u)). Then the MAP estimate is given by
x_MAP = rgmin_z 0.5 | x - z |_2^2/smoothing_strength + g(z) = prox_g^smoothing_strength(x)
Then proximal operators are denoisers.
Remark (Denoisers are not necessarily proximal operators): Data-driven denoisers are not necessarily proximal operators (see https://arxiv.org/pdf/2201.13256)
- priorRestorationPrior
Prior of the RestorationPrior type. In order to stay within the MYULA framework the restorator of RestorationPrior must be a proximal operator.
- smoothing_strengthfloat
Smoothing strength of the Moreau-Yoshida envelope of the prior potential.
- __init__(prior, smoothing_strength=0.1, **kwargs)#
Initialize the core properties of the distribution.
- Parameters:
name (str, default None) – Name of distribution.
geometry (Geometry, default _DefaultGeometry (or None)) – Geometry of distribution.
is_symmetric (bool, default None) – Indicator if distribution is symmetric.
Methods
__init__
(prior[, smoothing_strength])Initialize the core properties of the distribution.
Disable finite difference approximation for logd gradient.
enable_FD
([epsilon])Enable finite difference approximation for logd gradient.
Returns the conditioning variables of the distribution.
Return any public variable that is mutable (attribute or property) except those in the ignore_vars list
Returns the names of the parameters that the density can be evaluated at or conditioned on.
gradient
(x)This is the gradient of the regularizer ie gradient of the negative logpdf of the implicit prior.
logd
(*args, **kwargs)Evaluate the un-normalized log density function of the distribution.
logpdf
(x)The logpdf function.
pdf
(x)Evaluate the log probability density function of the distribution.
sample
([N])Sample from the distribution.
to_likelihood
(data)Convert conditional distribution to a likelihood function given observed data
Attributes
Returns True if finite difference approximation of the logd gradient is enabled.
Spacing for the finite difference approximation of the logd gradient.
Return the dimension of the distribution based on the geometry.
Return the geometry of the distribution.
Returns True if instance (self) is a conditional distribution.
Name of the random variable associated with the density.
Getter for the MoreauYoshida prior.
smoothing_strength of the distribution