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
Open sidebar
ift
NIFTy
Commits
c6791711
Commit
c6791711
authored
Mar 06, 2020
by
Philipp Arras
Browse files
Fixup
parent
fc815ff3
Pipeline
#70287
passed with stages
in 15 minutes and 24 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/operators/energy_operators.py
View file @
c6791711
...
...
@@ -138,7 +138,7 @@ class VariableCovarianceGaussianEnergy(EnergyOperator):
return
res
mf
=
{
self
.
_r
:
x
.
val
[
self
.
_icov
],
self
.
_icov
:
.
5
*
x
.
val
[
self
.
_icov
]
**
(
-
2
)}
metric
=
makeOp
(
MultiField
.
from_dict
(
mf
))
return
res
.
add_metric
(
SandwichOperator
(
x
.
jac
,
metric
))
return
res
.
add_metric
(
SandwichOperator
.
make
(
x
.
jac
,
metric
))
class
GaussianEnergy
(
EnergyOperator
):
...
...
test/test_energy_gradients.py
View file @
c6791711
...
...
@@ -48,6 +48,7 @@ def test_variablecovariancegaussian(field):
mf
=
ift
.
MultiField
.
from_dict
(
dc
)
energy
=
ift
.
VariableCovarianceGaussianEnergy
(
field
.
domain
,
'a'
,
'b'
)
ift
.
extra
.
check_jacobian_consistency
(
energy
,
mf
,
tol
=
1e-6
)
energy
(
ift
.
Linearization
.
make_var
(
mf
,
want_metric
=
True
)).
metric
.
draw_sample
()
def
test_gaussian
(
field
):
...
...
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