diff --git a/nifty4/library/nonlinear_power_energy.py b/nifty4/library/nonlinear_power_energy.py index bc922046d8b0c301c8c959bdf449365c3c0e0e40..b311cd22728a771393509d2f674aff9457464dec 100644 --- a/nifty4/library/nonlinear_power_energy.py +++ b/nifty4/library/nonlinear_power_energy.py @@ -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 diff --git a/nifty4/operators/endomorphic_operator.py b/nifty4/operators/endomorphic_operator.py index 0046d898627c9a47f007d2f9213bc1b3db27d0bf..af511f9acdb08d157a15ed82bad822ffb82b84ea 100644 --- a/nifty4/operators/endomorphic_operator.py +++ b/nifty4/operators/endomorphic_operator.py @@ -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) diff --git a/nifty4/probing/utils.py b/nifty4/probing/utils.py index 27aa1b9dba7b5df75ef91ae1dfde03d617d9c526..7ef5574c23539607ef7232c7beabf25ff78ebeb0 100644 --- a/nifty4/probing/utils.py +++ b/nifty4/probing/utils.py @@ -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: diff --git a/test/test_energies/test_noise.py b/test/test_energies/test_noise.py index 92969e9f4691b9795b53c76435b656fc361b0d25..324bf750e447ae3d9924b58d0690f271aaeaab4d 100644 --- a/test/test_energies/test_noise.py +++ b/test/test_energies/test_noise.py @@ -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)