KullbackLeibler¶
- class odl.solvers.functional.default_functionals.KullbackLeibler(*args, **kwargs)[source]¶
Bases:
FunctionalThe Kullback-Leibler divergence functional.
See also
KullbackLeiblerConvexConjthe convex conjugate functional
KullbackLeiblerCrossEntropyrelated functional
Notes
The functional
with prior
is given by:
Note that we use the common definition 0 log(0) := 0. KL based objectives are common in MLEM optimization problems and are often used as data-matching term when data noise governed by a multivariate Poisson probability distribution is significant.
The functional is related to the Kullback-Leibler cross entropy functional
KullbackLeiblerCrossEntropy. The KL cross entropy is the one diescribed in this Wikipedia article, and the functional
is obtained by switching place of the prior and
the varialbe in the KL cross entropy functional.For a theoretical exposition, see Csiszar1991.
References
- Attributes:
adjointAdjoint of this operator (abstract).
convex_conjThe convex conjugate functional of the KL-functional.
domainSet of objects on which this operator can be evaluated.
grad_lipschitzLipschitz constant for the gradient of the functional.
gradientGradient of the KL functional.
inverseReturn the operator inverse.
is_functionalTrueif this operator's range is aField.is_linearTrueif this operator is linear.priorThe prior in the Kullback-Leibler functional.
proximalReturn the
proximal factoryof the functional.rangeSet in which the result of an evaluation of this operator lies.
Methods
__call__(x[, out])Return
self(x[, out, **kwargs]).bregman(point, subgrad)Return the Bregman distance functional.
derivative(point)Return the derivative operator in the given point.
norm([estimate])Return the operator norm of this operator.
translated(shift)Return a translation of the functional.
- __init__(space, prior=None)[source]¶
Initialize a new instance.
- Parameters:
- space
DiscretizedSpaceorTensorSpace Domain of the functional.
- prior
spaceelement-like, optional Depending on the context, the prior, target or data distribution. It is assumed to be nonnegative. Default: if None it is take as the one-element.
- space
Examples
Test that KullbackLeibler(x,x) = 0
>>> space = odl.rn(3) >>> prior = 3 * space.one() >>> func = odl.solvers.KullbackLeibler(space, prior=prior) >>> func(prior) 0.0
Test that zeros in the prior are handled correctly
>>> prior = space.zero() >>> func = odl.solvers.KullbackLeibler(space, prior=prior) >>> x = space.one() >>> func(x) 3.0