Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
ift
NIFTy
Commits
4dc6837e
Commit
4dc6837e
authored
Jul 24, 2018
by
Reimar H Leike
Browse files
added consistency tests for the energies in the energies/ subdirectory
parent
da4c17b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test_energies/consistency_check.py
View file @
4dc6837e
...
...
@@ -74,6 +74,25 @@ class Energy_Tests(unittest.TestCase):
energy
=
ift
.
PoissonianEnergy
(
model
,
d
)
ift
.
extra
.
check_value_gradient_consistency
(
energy
)
@
expand
(
product
(
[
'Variable'
],
[
ift
.
GLSpace
(
15
),
ift
.
RGSpace
(
64
,
distances
=
.
789
),
ift
.
RGSpace
([
32
,
32
],
distances
=
.
789
)],
[
4
,
78
,
23
]
))
def
testHamiltonian_and_KL
(
self
,
type1
,
space
,
seed
):
model
=
self
.
make_model
(
type1
,
space_key
=
's1'
,
space
=
space
,
seed
=
seed
)[
's1'
]
model
=
ift
.
PointwiseExponential
(
model
)
lh
=
ift
.
GaussianEnergy
(
model
)
hamiltonian
=
ift
.
Hamiltonian
(
lh
)
ift
.
extra
.
check_value_gradient_consistency
(
hamiltonian
)
S
=
ift
.
ScalingOperator
(
1.
,
space
)
samps
=
[
S
.
draw_sample
()
for
i
in
range
(
3
)]
kl
=
ift
.
SampledKullbachLeiblerDivergence
(
hamiltonian
,
samps
)
ift
.
extra
.
check_value_gradient_consistency
(
kl
)
@
expand
(
product
(
[
'Variable'
],
[
ift
.
GLSpace
(
15
),
...
...
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