Commit 08151150 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

fixes

parent d05cb5ce
...@@ -46,12 +46,17 @@ class CorrelatedField(Operator): ...@@ -46,12 +46,17 @@ class CorrelatedField(Operator):
self._p_space = amplitude_model.target[0] self._p_space = amplitude_model.target[0]
self._power_distributor = PowerDistributor(self._h_space, self._power_distributor = PowerDistributor(self._h_space,
self._p_space) self._p_space)
self._domain = MultiDomain.union(
(self._amplitude_model.domain,
MultiDomain.make({"xi": self._h_space})))
@property @property
def domain(self): def domain(self):
return MultiDomain.union( return self._domain
(self._amplitude_model.domain,
MultiDomain.make({"xi": self._h_space}))) @property
def target(self):
return self._ht.target
def __call__(self, x): def __call__(self, x):
A = self._power_distributor(self._amplitude_model(x)) A = self._power_distributor(self._amplitude_model(x))
......
...@@ -40,7 +40,7 @@ class Energy_Tests(unittest.TestCase): ...@@ -40,7 +40,7 @@ class Energy_Tests(unittest.TestCase):
def testGaussian(self, space, seed): def testGaussian(self, space, seed):
model = self.make_model( model = self.make_model(
space_key='s1', space=space, seed=seed)['s1'] space_key='s1', space=space, seed=seed)['s1']
energy = ift.GaussianEnergy() energy = ift.GaussianEnergy(domain=space)
ift.extra.check_value_gradient_consistency(energy, model) ift.extra.check_value_gradient_consistency(energy, model)
# @expand(product( # @expand(product(
...@@ -81,7 +81,7 @@ class Energy_Tests(unittest.TestCase): ...@@ -81,7 +81,7 @@ class Energy_Tests(unittest.TestCase):
model = self.make_model( model = self.make_model(
space_key='s1', space=space, seed=seed)['s1'] space_key='s1', space=space, seed=seed)['s1']
model = model.exp() model = model.exp()
lh = ift.GaussianEnergy() lh = ift.GaussianEnergy(domain=space)
hamiltonian = ift.Hamiltonian(lh) hamiltonian = ift.Hamiltonian(lh)
ift.extra.check_value_gradient_consistency(hamiltonian, model) ift.extra.check_value_gradient_consistency(hamiltonian, model)
S = ift.ScalingOperator(1., space) S = ift.ScalingOperator(1., space)
......
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