pele.optimize.LBFGS#

class pele.optimize.LBFGS(X, pot, maxstep=0.1, maxErise=0.0001, M=4, rel_energy=False, H0=0.1, events=None, alternate_stop_criterion=None, debug=False, iprint=-1, nsteps=10000, tol=1e-05, logger=None, energy=None, gradient=None, armijo=False, armijo_c=0.0001, fortran=False)[source]#

minimize a function using the LBFGS routine

Parameters:
Xarray

the starting configuration for the minimization

pot

the potential object

nstepsint

the maximum number of iterations

tolfloat

the minimization will stop when the rms grad is less than tol

iprintint

how often to print status information

maxstepfloat

the maximum step size

maxErisefloat

the maximum the energy is alowed to rise during a step. The step size will be reduced until this condition is satisfied.

Mint

the number of previous iterations to use in determining the optimal step

rel_energybool

if True, then maxErise the the relative maximum the energy is allowed to rise during a step

H0float

the initial guess for the inverse diagonal Hessian. This particular implementation of LBFGS takes all the inverse diagonal components to be the same.

eventslist of callables

these are called after each iteration. events can also be added using attachEvent()

alternate_stop_criterioncallable

this criterion will be used rather than rms gradiant to determine when to stop the iteration

debug

print debugging information

loggerlogger object

messages will be passed to this logger rather than the default

energy, gradientfloat, float array

The initial energy and gradient. If these are both not None then the energy and gradient of the initial point will not be calculated, saving one potential call.

armijobool

Use the Armijo criterion instead of maxErise as the criterion for accepting a step size. The Armijo criterion is the first wolfe criterion and is a condition that the energy decrease sufficiently

armijo_cfloat

This adjusts how strong the armijo rule is. 0 < armijo_c < 1. Default 1e-4

fortranbool

use the fortran version of the LBFGS. Only the step which computes the step size and direction from the memory is in fortran.

See also

MYLBFGS

this implemented in a compiled language

pele.optimize.lbfgs_py

a function wrapper

Notes

This each iteration of this minimization routine is composed of the following parts

  1. determine a step size and direction using the LBFGS algorithm

  2. ensure the step size is appropriate (see maxErise and maxstep). Reduce the step size until conditions are satisfied.

  3. take step

http://dx.doi.org/10.1007/BF01589116

Methods

adjustStepSize(X, E, G, stp)

We now have a proposed step.

attachEvent(event)

getStep(X, G)

update the LBFGS memory and compute a step direction and size

get_result()

return a results object

get_state()

return the state of the LBFGS memory

one_iteration()

do one iteration of the LBFGS loop

reset()

reset the LBFGS memory and H0

run()

run the LBFGS minimizer

set_state(state)

set the LBFGS memory from the passed state

stop_criterion_satisfied()

test the stop criterion

update_coords(X, E, G)

change the location of the minimizer manually

Attributes