Commit 0ad8d58f authored by Reimar H Leike's avatar Reimar H Leike
Browse files

added an inversion test for WinerFilterCovariance

parent 7aff191c
......@@ -72,6 +72,31 @@ def test_quadratic_minimization(minimizer, space):
rtol=1e-3,
atol=1e-3)
@pmp('space', spaces)
def test_WF_curvature(space):
np.random.seed(42)
starting_point = ift.Field.from_random('normal', domain=space)*10
required_result = ift.full(space, 1.)
s = ift.Field.from_random('uniform', domain=space) + 0.5
S = ift.DiagonalOperator(s)
r = ift.Field.from_random('uniform', domain=space)
R = ift.DiagonalOperator(r)
n = ift.Field.from_random('uniform', domain=space) + 0.5
N = ift.DiagonalOperator(n)
all_diag = 1./s + r**2/n
curv = ift.WienerFilterCurvature(R,N,S, iteration_controller=IC, iteration_controller_sampling=IC)
m = curv.inverse(required_result)
assert_allclose(
m.local_data,
1./all_diag.local_data,
rtol=1e-3,
atol=1e-3)
curv.draw_sample()
curv.draw_sample(from_inverse=True)
@pmp('minimizer', minimizers + newton_minimizers)
def test_rosenbrock(minimizer):
......
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