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
b4282bfe
Commit
b4282bfe
authored
Mar 06, 2020
by
Reimar Leike
Browse files
fix merge conflict
parents
f2e283bf
b2c5e03d
Pipeline
#70291
passed with stages
in 15 minutes and 30 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/operators/energy_operators.py
View file @
b4282bfe
...
...
@@ -128,11 +128,9 @@ class VariableCovarianceGaussianEnergy(EnergyOperator):
def
apply
(
self
,
x
):
self
.
_check_input
(
x
)
res0
=
x
[
self
.
_r
].
vdot
(
x
[
self
.
_r
]
*
x
[
self
.
_icov
]).
absolute
()
res0
=
x
[
self
.
_r
].
vdot
(
x
[
self
.
_r
]
*
x
[
self
.
_icov
]).
real
res1
=
x
[
self
.
_icov
].
log
().
sum
()
res
=
0.5
*
(
res0
-
res1
)
if
(
not
isinstance
(
x
,
Linearization
))
or
(
not
x
.
want_metric
):
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
.
make
(
x
.
jac
,
metric
))
...
...
Write
Preview
Supports
Markdown
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