RestorationPrior#
- class cuqi.implicitprior.RestorationPrior(restorator, restorator_kwargs=None, potential=None, **kwargs)#
This class defines an implicit distribution associated with a restoration operator (eg denoiser). They are several works relating restorations operators with priors, see
-Laumont et al. https://arxiv.org/abs/2103.04715 -Hu et al. https://openreview.net/pdf?id=x7d1qXEn1e
We cannot sample from this distribution, neither compute its logpdf except in some cases. It allows us to apply algorithms such as MYULA and PnPULA.
- Parameters:
restorator (callable f(x, restoration_strength)) – Function f that accepts input x to be restored and returns the restored version of x and information about the restoration operation.
restorator_kwargs (dictionary) – Dictionary containing information about the restorator. It contains keyword argument parameters that will be passed to the restorator f. An example could be algorithm parameters such as the number of iterations or the stopping criteria.
potential (callable function, optional) – The potential corresponds to the negative logpdf when it is accessible. This function is a mapping from the parameter domain to the real set. It can be provided if the user knows how to relate it to the restorator. Ex: restorator is the proximal operator of the total variation (TV), then potential is the TV function.
- __init__(restorator, restorator_kwargs=None, potential=None, **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__
(restorator[, restorator_kwargs, ...])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
(*args, **kwargs)Returns the gradient of the log density at x.
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.
restore
(x, restoration_strength)This function allows us to restore the input x and returns the restored version of x.
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.