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
e3f9d9b4
Commit
e3f9d9b4
authored
Apr 09, 2020
by
Philipp Arras
Browse files
Add multi field support for find_position
parent
9974ac4e
Pipeline
#72640
passed with stages
in 19 minutes and 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/sugar.py
View file @
e3f9d9b4
...
...
@@ -496,7 +496,10 @@ def calculate_position(operator, output):
raise
TypeError
if
output
.
domain
!=
operator
.
target
:
raise
TypeError
cov
=
1e-3
*
output
.
val
.
max
()
**
2
if
isinstance
(
output
,
MultiField
):
cov
=
1e-3
*
max
([
vv
.
max
()
for
vv
in
output
.
val
.
values
()])
**
2
else
:
cov
=
1e-3
*
output
.
val
.
max
()
**
2
invcov
=
ScalingOperator
(
output
.
domain
,
cov
).
inverse
d
=
output
+
invcov
.
draw_sample
(
from_inverse
=
True
)
lh
=
GaussianEnergy
(
d
,
invcov
)
@
operator
...
...
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