Commit 7f4ca255 authored by Martin Reinecke's avatar Martin Reinecke

be more fussy about convergence

parent dd3c67f3
Pipeline #23417 passed with stage
in 4 minutes and 35 seconds
......@@ -47,7 +47,7 @@ if __name__ == "__main__":
# Wiener filter
m0 = ift.Field.zeros(harmonic_space)
ctrl = ift.GradientNormController(verbose=False, tol_abs_gradnorm=1)
ctrl = ift.GradientNormController(verbose=False, tol_abs_gradnorm=0.0001)
ctrl2 = ift.GradientNormController(verbose=True, tol_abs_gradnorm=0.1,
name="outer")
inverter = ift.ConjugateGradient(controller=ctrl)
......
......@@ -104,7 +104,10 @@ class LineSearchStrongWolfe(LineSearch):
old_phi_0 = f_k_minus_1
phi_0 = le_0.value
phiprime_0 = le_0.directional_derivative
if phiprime_0 >= 0:
if phiprime_0 == 0:
dobj.mprint("Directional derivative is zero; assuming convergence")
return energy
if phiprime_0 > 0:
dobj.mprint("Error: search direction is not a descent direction")
raise ValueError("search direction must be a descent direction")
......
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