Commit 94ea7638 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

more backtracking

parent 515c7f38
Pipeline #77344 passed with stages
in 12 minutes and 5 seconds
......@@ -216,7 +216,8 @@ class LineSearch(metaclass=NiftyMeta):
alpha1 = (alpha0+alpha1)/2
continue # next iteration
if np.isinf(phi_alpha1) or np.isnan(phi_alpha1): # also backtrack
if (np.isinf(phi_alpha1) or np.isnan(phi_alpha1)
or np.abs(phi_alpha1) > 1e100): # also backtrack
  • Minor stylistic nit-picking: np.abs(phi_alpha1) > 1e100) will always be true if np.isinf(phi_alpha1). Though stating both might be more explicit and readable...

  • Good point, thanks!

Please register or sign in to reply
alpha1 = (alpha0+alpha1)/2
continue # next iteration
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment