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
afc3e2df
Commit
afc3e2df
authored
Jul 02, 2020
by
Martin Reinecke
Browse files
Merge branch 'paranoid_line_search' into 'NIFTy_6'
Try to avoid crashes in the line searcher See merge request
!550
parents
8e168463
216f3aa8
Pipeline
#84636
passed with stages
in 25 minutes and 56 seconds
Changes
1
Pipelines
111
Hide whitespace changes
Inline
Side-by-side
nifty6/minimization/line_search.py
View file @
afc3e2df
...
...
@@ -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
.
isnan
(
phi_alpha1
)
or
np
.
abs
(
phi_alpha1
)
>
1e100
:
# 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
)):
...
...
Gordian Edenhofer
@gedenhof
mentioned in issue
#312 (closed)
·
Oct 20, 2020
mentioned in issue
#312 (closed)
mentioned in issue #312
Toggle commit list
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