Commit 3bdf5f8a authored by Philipp Arras's avatar Philipp Arras

Revert changes not to be merged

parent 354f8482
Pipeline #52264 passed with stages
in 8 minutes and 20 seconds
......@@ -63,20 +63,16 @@ class SamplingEnabler(EndomorphicOperator):
s = self._prior.draw_sample(from_inverse=True)
sp = self._prior(s)
nj = self._likelihood.draw_sample()
energy = QuadraticEnergy(s, self._op, sp + nj,
_grad=self._likelihood(s) - nj)
inverter = ConjugateGradient(self._ic)
if self._approximation is not None:
energy = QuadraticEnergy(s, self._op, sp + nj)
energy, convergence = inverter(
energy, preconditioner=self._approximation.inverse)
else:
energy = QuadraticEnergy(s, self._op, sp + nj,
_grad=self._likelihood(s) - nj)
energy, convergence = inverter(energy)
return energy.position
def add_approximation(self, approx):
self._approximation = approx
def apply(self, x, mode):
return self._op.apply(x, mode)
......
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