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
4855ce88
Commit
4855ce88
authored
Jun 28, 2018
by
Reimar H Leike
Browse files
sneaking in a little change such that the tolerance is independant of the dimension
parent
a2c29670
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/extra/energy_and_model_tests.py
View file @
4855ce88
...
...
@@ -83,7 +83,7 @@ def check_value_gradient_consistency(E, tol=1e-8, ntries=100):
dirder
=
Emid
.
gradient
(
dir
)
/
dirnorm
numgrad
=
(
E2
.
value
-
val
)
/
dirnorm
if
isinstance
(
E
,
Model
):
xtol
=
tol
*
dirder
.
norm
()
xtol
=
tol
*
dirder
.
norm
()
/
np
.
sqrt
(
dirder
.
size
)
if
(
abs
(
numgrad
-
dirder
)
<
xtol
).
all
():
break
else
:
...
...
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