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
7e3f46ba
Commit
7e3f46ba
authored
Apr 18, 2020
by
Philipp Arras
Browse files
Merge branch 'support_mf_calcpos' into 'NIFTy_6'
Add multi field support for find_position See merge request
!445
parents
f9d8ed85
e3f9d9b4
Pipeline
#73142
passed with stages
in 29 minutes and 28 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/sugar.py
View file @
7e3f46ba
...
...
@@ -493,7 +493,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