Commit 1db37c41 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'pa' into 'NIFTy_7'

Various updates

See merge request !611
parents 8dc99b9f 486fda18
Pipeline #97279 passed with stages
in 24 minutes and 56 seconds
......@@ -19,6 +19,8 @@ References
.. [2] Steininger et al., "NIFTy 3 - Numerical Information Field Theory - A Python framework for multicomponent signal inference on HPC clusters", 2017, accepted by Annalen der Physik; `[arXiv:1708.01073] <https://arxiv.org/abs/1708.01073>`_
.. [3] Arras et al., "NIFTy5: Numerical Information Field Theory v5", 2019, Astrophysics Source Code Library; `[ascl:1903.008] <http://ascl.net/1903.008>`_
Contents
........
......
......@@ -38,9 +38,6 @@ class _KLMetric(EndomorphicOperator):
self._check_input(x, mode)
return self._KL.apply_metric(x)
def draw_sample(self, from_inverse=False):
return self._KL._metric_sample(from_inverse)
def _get_lo_hi(comm, n_samples):
ntask, rank, _ = utilities.get_MPI_params_from_comm(comm)
......@@ -260,22 +257,3 @@ class MetricGaussianKL(Energy):
yield s
if self._mirror_samples:
yield -s
def _metric_sample(self, from_inverse=False):
if from_inverse:
raise NotImplementedError()
s = ('This draws from the Hamiltonian used for evaluation and does '
' not take point_estimates into accout. Make sure that this '
'is your intended use.')
logger.warning(s)
lin = Linearization.make_var(self.position, True)
samp = []
sseq = random.spawn_sseq(self._n_samples)
for i, s in enumerate(self._local_samples):
s = _modify_sample_domain(s, self._hamiltonian.domain)
with random.Context(sseq[self._lo+i]):
tmp = self._hamiltonian(lin+s).metric.draw_sample(from_inverse=False)
if self._mirror_samples:
tmp = tmp + self._hamiltonian(lin-s).metric.draw_sample(from_inverse=False)
samp.append(tmp)
return utilities.allreduce_sum(samp, self._comm)/self.n_eff_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