Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
11
Issues
11
List
Boards
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
998d3b9e
Commit
998d3b9e
authored
Jan 31, 2019
by
Philipp Arras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs
parent
1ca27aa8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
21 deletions
+28
-21
nifty5/minimization/metric_gaussian_kl.py
nifty5/minimization/metric_gaussian_kl.py
+28
-21
No files found.
nifty5/minimization/metric_gaussian_kl.py
View file @
998d3b9e
...
...
@@ -25,42 +25,49 @@ class MetricGaussianKL(Energy):
"""Provides the sampled Kullback-Leibler divergence between a distribution
and a Metric Gaussian.
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
A Metric Gaussian is used to approximate
another probability
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, 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
t
hese samples have to be updated by re-initializing this class at som
e
point. Here standard parametrization of the true distribu
tion is assumed.
sampling the Metric Gaussian at the current mean. During minimization
these samples are kept constant; only the mean is updated. Due to
the
typically nonlinear structure of the true distribution these samples have
t
o be updated eventually by intantiating `MetricGaussianKL` again. For th
e
true probability distribution the standard parametriza
tion is assumed.
Parameters
----------
mean : Field
The current mean of the Gaussia
n.
Mean of the Gaussian probability distributio
n.
hamiltonian : StandardHamiltonian
The Standard
Hamiltonian of the approximated probability distribution.
Hamiltonian of the approximated probability distribution.
n_samples : integer
The n
umber of samples used to stochastically estimate the KL.
N
umber of samples used to stochastically estimate the KL.
constants : list
A list of parameter keys that are kept constant during optimization.
List of parameter keys that are kept constant during optimization.
Default is no constants.
point_estimates : list
A list of parameter keys for which no samples are drawn, but that are
optimized for, corresponding to point estimates of these.
List of parameter keys for which no samples are drawn, but that are
(possibly) optimized for, corresponding to point estimates of these.
Default is to draw samples for the complete domain.
mirror_samples : boolean
Whether the negative of the drawn samples are also used,
as they are equaly legitimate samples. If true, the number of used
as they are equal
l
y legitimate samples. If true, the number of used
samples doubles. Mirroring samples stabilizes the KL estimate as
extreme sample variation is counterbalanced.
(default : False)
extreme sample variation is counterbalanced.
Default is False.
_samples : None
Only a parameter for internal uses. Typically not to be set by users.
Notes
-----
For further details see: Metric Gaussian Variational Inference
(FIXME in preparation)
Note
----
The two lists `constants` and `point_estimates` are independent from each
other. It is possible to sample along domains which are kept constant
during minimization and vice versa.
See also
--------
Metric Gaussian Variational Inference (FIXME in preparation)
"""
def
__init__
(
self
,
mean
,
hamiltonian
,
n_samples
,
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