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
515c7f38
Commit
515c7f38
authored
Jun 24, 2020
by
Martin Reinecke
Browse files
try to avoid crashes in the line searcher
parent
a6bbaa1e
Pipeline
#77209
passed with stages
in 12 minutes and 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/minimization/line_search.py
View file @
515c7f38
...
...
@@ -209,8 +209,16 @@ class LineSearch(metaclass=NiftyMeta):
if
alpha1
==
0
:
return
le_0
.
energy
,
False
le_alpha1
=
le_0
.
at
(
alpha1
)
phi_alpha1
=
le_alpha1
.
value
try
:
le_alpha1
=
le_0
.
at
(
alpha1
)
phi_alpha1
=
le_alpha1
.
value
except
FloatingPointError
:
# backtrack
alpha1
=
(
alpha0
+
alpha1
)
/
2
continue
# next iteration
if
np
.
isinf
(
phi_alpha1
)
or
np
.
isnan
(
phi_alpha1
):
# also backtrack
alpha1
=
(
alpha0
+
alpha1
)
/
2
continue
# next iteration
if
(
phi_alpha1
>
phi_0
+
self
.
c1
*
alpha1
*
phiprime_0
)
or
\
((
phi_alpha1
>=
phi_alpha0
)
and
(
iteration_number
>
1
)):
...
...
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