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
157402e6
Commit
157402e6
authored
May 02, 2019
by
Martin Reinecke
Browse files
Merge branch 'fixing_nan' into 'NIFTy_5'
Fixing NaNs in PoissonEnergy See merge request
!321
parents
fb34b7ce
dafe2922
Pipeline
#47817
passed with stages
in 18 minutes and 49 seconds
Changes
1
Pipelines
6
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/energy_operators.py
View file @
157402e6
...
...
@@ -191,7 +191,12 @@ class PoissonianEnergy(EnergyOperator):
def
apply
(
self
,
x
):
self
.
_check_input
(
x
)
res
=
x
.
sum
()
-
x
.
log
().
vdot
(
self
.
_d
)
res
=
x
.
sum
()
tmp
=
res
.
val
.
local_data
if
isinstance
(
res
,
Linearization
)
else
res
# if we have no infinity here, we can continue with the calculation;
# otherwise we know that the result must also be infinity
if
not
np
.
isinf
(
tmp
):
res
=
res
-
x
.
log
().
vdot
(
self
.
_d
)
if
not
isinstance
(
x
,
Linearization
):
return
Field
.
scalar
(
res
)
if
not
x
.
want_metric
:
...
...
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