Commit ecedc71f authored by Martin Reinecke's avatar Martin Reinecke

Merge branch 'cosm' into 'NIFTy_5'

Cosm

See merge request ift/nifty-dev!204
parents 1a9b8429 ab3f1c2f
...@@ -29,4 +29,6 @@ add_module_names = False ...@@ -29,4 +29,6 @@ add_module_names = False
html_theme = "sphinx_rtd_theme" html_theme = "sphinx_rtd_theme"
html_logo = 'nifty_logo_black.png' html_logo = 'nifty_logo_black.png'
exclude_patterns = ['mod/modules.rst', 'mod/*version.rst'] exclude_patterns = [
'mod/modules.rst', 'mod/nifty5.git_version.rst', 'mod/nifty5.logger.rst'
]
...@@ -14,12 +14,12 @@ Plotting support is added via:: ...@@ -14,12 +14,12 @@ Plotting support is added via::
pip3 install --user matplotlib pip3 install --user matplotlib
FFTW support is added via: FFTW support is added via::
sudo apt-get install libfftw3-dev sudo apt-get install libfftw3-dev
pip3 install --user pyfftw pip3 install --user pyfftw
To actually use FFTW in your Nifty calculations, you need to call To actually use FFTW in your Nifty calculations, you need to call::
nifty5.fft.enable_fftw() nifty5.fft.enable_fftw()
......
...@@ -57,10 +57,10 @@ class MetricGaussianKL(Energy): ...@@ -57,10 +57,10 @@ class MetricGaussianKL(Energy):
Notes Notes
----- -----
For further details see: Metric Gaussian Variational Inference For further details see: Metric Gaussian Variational Inference
(in preparation) (FIXME in preparation)
""" """
def __init__(self, mean, hamiltonian, n_sampels, constants=[], def __init__(self, mean, hamiltonian, n_samples, constants=[],
point_estimates=None, mirror_samples=False, point_estimates=None, mirror_samples=False,
_samples=None): _samples=None):
super(MetricGaussianKL, self).__init__(mean) super(MetricGaussianKL, self).__init__(mean)
...@@ -75,7 +75,7 @@ class MetricGaussianKL(Energy): ...@@ -75,7 +75,7 @@ class MetricGaussianKL(Energy):
met = hamiltonian(Linearization.make_partial_var( met = hamiltonian(Linearization.make_partial_var(
mean, point_estimates, True)).metric mean, point_estimates, True)).metric
_samples = tuple(met.draw_sample(from_inverse=True) _samples = tuple(met.draw_sample(from_inverse=True)
for _ in range(n_sampels)) for _ in range(n_samples))
if mirror_samples: if mirror_samples:
_samples += tuple(-s for s in _samples) _samples += tuple(-s for s in _samples)
self._samples = _samples self._samples = _samples
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment