Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
5cae24a5
Commit
5cae24a5
authored
Jan 23, 2019
by
Reimar H Leike
Browse files
added tests on composed operators, replaced 'model' test with operator test
parent
a4a1c61a
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/test_operators/test_adjoint.py
View file @
5cae24a5
...
...
@@ -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
():
...
...
test/test_
model
_gradients.py
→
test/test_
operators/test
_gradients.py
View file @
5cae24a5
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment