Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
e29d3456
Commit
e29d3456
authored
Jun 28, 2018
by
Philipp Arras
Browse files
Fix test
parent
227bdaea
Changes
1
Show whitespace changes
Inline
Side-by-side
test/test_energies/test_map.py
View file @
e29d3456
...
...
@@ -67,7 +67,7 @@ class Energy_Tests(unittest.TestCase):
ift
.
RGSpace
([
32
,
32
],
distances
=
.
789
)],
[
ift
.
Tanh
,
ift
.
Exponential
,
ift
.
Linear
],
[
4
,
78
,
23
]))
def
test
NonlinearMap
(
self
,
space
,
nonlinearity
,
seed
):
def
test
GaussianEnergy
(
self
,
space
,
nonlinearity
,
seed
):
np
.
random
.
seed
(
seed
)
f
=
nonlinearity
()
dim
=
len
(
space
.
shape
)
...
...
@@ -85,14 +85,11 @@ class Energy_Tests(unittest.TestCase):
n
=
ift
.
Field
.
from_random
(
domain
=
space
,
random_type
=
'normal'
)
s
=
ht
(
ift
.
makeOp
(
A
)(
xi0_var
))
R
=
ift
.
ScalingOperator
(
10.
,
space
)
sqrt
N
=
ift
.
ScalingOperator
(
1.
,
space
)
N
=
ift
.
ScalingOperator
(
1.
,
space
)
d_model
=
R
(
ift
.
LocalModel
(
s
,
nonlinearity
()))
d
=
d_model
.
value
+
n
IC
=
ift
.
GradientNormController
(
iteration_limit
=
100
,
tol_abs_gradnorm
=
1e-5
)
energy
=
ift
.
NonlinearWienerFilterEnergy
(
d
,
d_model
,
sqrtN
,
IC
)
energy
=
ift
.
GaussianEnergy
(
d_model
,
d
,
N
)
if
isinstance
(
nonlinearity
,
ift
.
Linear
):
ift
.
extra
.
check_value_gradient_curvature_consistency
(
energy
,
ntries
=
10
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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