Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
acdb0aaf
Commit
acdb0aaf
authored
Jan 15, 2019
by
Jakob Knollmueller
Browse files
some docstrings on KL
parent
03c31669
Changes
1
Show whitespace changes
Inline
Side-by-side
nifty5/minimization/metric_gaussian_kl.py
View file @
acdb0aaf
...
...
@@ -21,17 +21,23 @@ from .. import utilities
class
MetricGaussianKL
(
Energy
):
"""Provides the sampled Kullback-Leibler divergence between a distribution and a
m
etric Gaussian.
"""Provides the sampled Kullback-Leibler divergence between a distribution and a
M
etric Gaussian.
The Energy object is an implementation of a scalar function including its
gradient and metric at some position.
A Metric Gaussian is used to approximate some other distribution.
It is a Gaussian distribution that uses the Fisher Information Metric
of the other distribution at the location of its mean to approximate the variance.
In order to infer the mean, the a stochastic estimate of the Kullback-Leibler divergence
is minimized. This estimate is obtained by drawing samples from the Metric Gaussian at the current mean.
During minimization these samples are kept constant, updating only the mean. Due to the typically nonlinear
structure of the true distribution these samples have to be updated by re-initializing this class at some point.
Here standard parametrization of the true distribution is assumed.
Parameters
----------
mean : Field
The current mean of the Gaussian.
hamiltonian : Hamiltonian
The Hamiltonian of the approximated probability distribution.
hamiltonian :
Standard
Hamiltonian
The
Standard
Hamiltonian of the approximated probability distribution.
n_samples : integer
The number of samples used to stochastically estimate the KL.
constants : list
...
...
@@ -47,15 +53,7 @@ class MetricGaussianKL(Energy):
Notes
-----
An instance of the Energy class is defined at a certain location. If one
is interested in the value, gradient or metric of the abstract energy
functional one has to 'jump' to the new position using the `at` method.
This method returns a new energy instance residing at the new position. By
this approach, intermediate results from computing e.g. the gradient can
safely be reused for e.g. the value or the metric.
Memorizing the evaluations of some quantities minimizes the computational
effort for multiple calls.
For further details see: Metric Gaussian Variational Inference (in preparation)
"""
def
__init__
(
self
,
mean
,
hamiltonian
,
n_sampels
,
constants
=
[],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment