Commit d92adfa3 authored by Martin Reinecke's avatar Martin Reinecke

remove inverse_draw_sample() for good

parent e9a5b0f1
Pipeline #26708 passed with stage
in 8 minutes and 29 seconds
......@@ -70,7 +70,7 @@ class NonlinearPowerEnergy(Energy):
if samples is None or samples == 0:
xi_sample_list = [xi]
else:
xi_sample_list = [D.inverse_draw_sample() + xi
xi_sample_list = [D.draw_sample(from_inverse=True) + xi
for _ in range(samples)]
self.xi_sample_list = xi_sample_list
self.inverter = inverter
......
......@@ -55,15 +55,3 @@ class EndomorphicOperator(LinearOperator):
A sample from the Gaussian of given covariance.
"""
raise NotImplementedError
def inverse_draw_sample(self, dtype=np.float64):
"""Generates a zero-mean sample
Generates a sample from a Gaussian distribution with zero mean and
covariance given by the inverse of the operator.
Returns
-------
A sample from the Gaussian of given covariance
"""
return self.draw_sample(True, dtype)
......@@ -51,7 +51,7 @@ class StatCalculator(object):
def probe_with_posterior_samples(op, post_op, nprobes):
sc = StatCalculator()
for i in range(nprobes):
sample = post_op(op.inverse_draw_sample())
sample = post_op(op.draw_sample(from_inverse=True))
sc.add(sample)
if nprobes == 1:
......
......@@ -84,7 +84,7 @@ class Noise_Energy_Tests(unittest.TestCase):
S=S,
inverter=inverter).curvature
res_sample_list = [d - R(f(ht(C.inverse_draw_sample() + xi)))
res_sample_list = [d - R(f(ht(C.draw_sample(from_inverse=True) + xi)))
for _ in range(10)]
energy = ift.library.NoiseEnergy(eta0, alpha, q, res_sample_list)
......
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