Commit b590d545 authored by Martin Reinecke's avatar Martin Reinecke


parent 62e87d98
Pipeline #53888 passed with stages
in 8 minutes and 4 seconds
...@@ -86,11 +86,12 @@ class MetricGaussianKL_MPI(Energy): ...@@ -86,11 +86,12 @@ class MetricGaussianKL_MPI(Energy):
for i in range(lo, hi): for i in range(lo, hi):
if mirror_samples: if mirror_samples:
np.random.seed(i//2+seed_offset) np.random.seed(i//2+seed_offset)
if i%2 and i-1 >= lo: if (i % 2) and (i-1 >= lo):
_samples.append(-_samples[-1]) _samples.append(-_samples[-1])
else: else:
_samples.append(((i%2)*2-1)*met.draw_sample(from_inverse=True)) _samples.append(((i % 2)*2-1) *
else: else:
np.random.seed(i) np.random.seed(i)
_samples.append(met.draw_sample(from_inverse=True)) _samples.append(met.draw_sample(from_inverse=True))
...@@ -122,7 +123,8 @@ class MetricGaussianKL_MPI(Energy): ...@@ -122,7 +123,8 @@ class MetricGaussianKL_MPI(Energy):
def at(self, position): def at(self, position):
return MetricGaussianKL_MPI( return MetricGaussianKL_MPI(
position, self._hamiltonian, self._n_samples, self._constants, position, self._hamiltonian, self._n_samples, self._constants,
self._point_estimates, _samples=self._samples, seed_offset=self._seed_offset) self._point_estimates, _samples=self._samples,
@property @property
def value(self): def value(self):
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment