Commit 5cae24a5 authored by Reimar H Leike's avatar Reimar H Leike
Browse files

added tests on composed operators, replaced 'model' test with operator test

parent a4a1c61a
......@@ -58,6 +58,8 @@ def testOperatorCombinations(sp, dtype):
ift.extra.consistency_check(op, dtype, dtype)
op = a + b
ift.extra.consistency_check(op, dtype, dtype)
op = a - b
ift.extra.consistency_check(op, dtype, dtype)
def testLinearInterpolator():
......
......@@ -21,7 +21,7 @@ from numpy.testing import assert_
import nifty5 as ift
from .common import list2fixture
from ..common import list2fixture
pmp = pytest.mark.parametrize
space = list2fixture([
......@@ -81,6 +81,12 @@ def testBinary(type1, type2, space, seed):
pos = ift.from_random("normal", dom)
model = ift.OuterProduct(pos['s1'], ift.makeDomain(space))
ift.extra.check_value_gradient_consistency(model, pos['s2'], ntries=20)
model = select_s1 **2
pos = ift.from_random("normal", dom1)
ift.extra.check_value_gradient_consistency(model, pos, ntries=20)
model = select_s1.clip(-1,1)
pos = ift.from_random("normal", dom1)
ift.extra.check_value_gradient_consistency(model, pos, ntries=20)
if isinstance(space, ift.RGSpace):
model = ift.FFTOperator(space)(select_s1*select_s2)
pos = ift.from_random("normal", dom)
......
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