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
35a44a2e
Commit
35a44a2e
authored
Jun 28, 2018
by
Reimar H Leike
Browse files
eliminated 2 TODOs
parent
5dbc6d90
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty5/extra/energy_and_model_tests.py
View file @
35a44a2e
...
...
@@ -25,7 +25,6 @@ __all__ = ["check_value_gradient_consistency",
def
_get_acceptable_model
(
M
):
# TODO: do for model
val
=
M
.
value
if
not
np
.
isfinite
(
val
.
sum
()):
raise
ValueError
(
'Initial Model value must be finite'
)
...
...
test/test_models/test_model_gradients.py
View file @
35a44a2e
...
...
@@ -31,9 +31,9 @@ class Model_Tests(unittest.TestCase):
[
4
,
78
,
23
]))
def
testMul
(
self
,
space
,
seed
):
np
.
random
.
seed
(
seed
)
# TODO: use random Multifields instead
s1
=
ift
.
full
(
space
,
np
.
random
.
randn
()
)
s2
=
ift
.
full
(
space
,
np
.
random
.
randn
()
)
S
=
ift
.
ScalingOperator
(
1.
,
space
)
s1
=
S
.
draw_sample
()
s2
=
S
.
draw_sample
()
s1_var
=
ift
.
Variable
(
ift
.
MultiField
({
's1'
:
s1
}))[
's1'
]
s2_var
=
ift
.
Variable
(
ift
.
MultiField
({
's2'
:
s2
}))[
's2'
]
ift
.
extra
.
check_value_gradient_consistency
(
s1_var
*
s2_var
)
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