IMTEK-Simulation / NuMPI

Utilities for MPI-parallel numerical calculations with Python
MIT License
2 stars 1 forks source link

Make the convergence check consistent with scipy's LBFGS #12

Closed sannant closed 5 years ago

sannant commented 5 years ago

In the underlying fortran code by Nocedal et al. (lbfgsb.f) makes an or condition between the two criterion.

c     Test for termination.

      if (sbgnrm .le. pgtol) then
c                                terminate the algorithm.
         task = 'CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL'
         goto 999
      endif 

      ddum = max(abs(fold), abs(f), one)
      if ((fold - f) .le. tol*ddum) then
c                                        terminate the algorithm.
         task = 'CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH'
         if (iback .ge. 10) info = -5
c           i.e., to issue a warning if iback>10 in the line search.
         goto 999
      endif 
sannant commented 5 years ago

This is now implemented this way, see https://github.com/IMTEK-Simulation/NuMPI/blob/b49ab198a8854c03b1580ee6b7c9b653aec97c9f/NuMPI/Optimization/MPI_LBFGS_Matrix_H.py#L221