Commit a0327b0f authored by Philipp Arras's avatar Philipp Arras

Simplify

parent 969a4295
Pipeline #52622 failed with stages
in 5 minutes and 33 seconds
......@@ -47,6 +47,7 @@ class SamplingEnabler(EndomorphicOperator):
def __init__(self, likelihood, prior, iteration_controller,
approximation=None):
self._op = likelihood + prior
# FIXME Separation in likelihood and prior not necessary
self._likelihood = likelihood
self._prior = prior
self._ic = iteration_controller
......@@ -60,10 +61,8 @@ class SamplingEnabler(EndomorphicOperator):
except NotImplementedError:
if not from_inverse:
raise ValueError("from_inverse must be True here")
s = self._prior.draw_sample(from_inverse=True)
sp = self._prior(s)
nj = self._likelihood.draw_sample()
energy = QuadraticEnergy(0*s, self._op, sp + nj)
b = self._op.draw_sample()
energy = QuadraticEnergy(0*b, self._op, b)
inverter = ConjugateGradient(self._ic)
if self._approximation is not None:
energy, convergence = inverter(
......
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