Commit ef60a287 authored by Lukas Platz's avatar Lukas Platz
Browse files

changed argument to 'gen_mirrored_samples' for clarity

not storing the value because it is not used after the
first initialization.
parent f78346e3
......@@ -8,7 +8,7 @@ from .. import utilities
class KL_Energy(Energy):
def __init__(self, position, h, nsamp, constants=[],
constants_samples=None, mirror_samples=False,
constants_samples=None, gen_mirrored_samples=False,
super(KL_Energy, self).__init__(position)
if h.domain is not position.domain:
......@@ -18,13 +18,12 @@ class KL_Energy(Energy):
if constants_samples is None:
constants_samples = constants
self._constants_samples = constants_samples
self._mirror_samples = mirror_samples
if _samples is None:
met = h(Linearization.make_partial_var(
position, constants_samples, True)).metric
_samples = tuple(met.draw_sample(from_inverse=True)
for _ in range(nsamp))
if mirror_samples:
if gen_mirrored_samples:
_samples += tuple(-s for s in _samples)
self._samples = _samples
......@@ -43,9 +42,9 @@ class KL_Energy(Energy):
self._metric = None
def at(self, position):
return KL_Energy(position, self._h, 0, self._constants,
self._constants_samples, self._mirror_samples,
return KL_Energy(position, self._h, 0,
self._constants, self._constants_samples,
_samples = self._samples)
def value(self):
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