Difference between revisions of "Lbfgs.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Created basic page for the lbfgs.m function)
 
(Arguments)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:lbfgs.m}}
 
{{DISPLAYTITLE:lbfgs.m}}
 
+
Calculates an approximation to the Newton-Raphson search direction using past gradients to build a serviceable substitute to a Hessian. The Hessian matrix is never explicitly formed or inverted. This function is the implementation from section 4 of http://dx.doi.org/10.1090/S0025-5718-1980-0572855-7
This function calculates the quasi-Newton update with the gradient history, giving the search direction. Based on the [[quasinewton.m|BFGS]] algorithm, this limited-memory BFGS (L-BFGS) algorithm stores only few vectors that implicitly represent the approximation of the BFGS algorithm (which stores a matrix equal to the number of optimisation variables)
 
  
 
==Syntax==
 
==Syntax==
  
     direction=lbfgs(x_hist,df_hist,grad,N)
+
     direction=lbfgs(dx_hist,dg_hist,g)
 
 
==Description==
 
This function is the implementation from section 4 of http://dx.doi.org/10.1090/S0025-5718-1980-0572855-7
 
  
 
==Arguments==
 
==Arguments==
 
              
 
              
    x_hist         - vector array of waveform history, num_var x size_store
+
    dx_hist         - history of x increments, a stack
+
                      of column vectors, from the latest
    df_hist        - vector array of gradient history, num_var x size_store
+
                      to the earliest
 
    grad          - vector of the current gradient, (num_vars x 1)
 
 
   
 
   
    N              - number of waveform/gradient vectors to store (default=20)
+
    dg_hist        - history of gradient increments,
 +
                      a stack of column vectors, from
 +
                      the latest to the earliest
 +
 
 +
    g              - current gradient
  
==Returns==
+
==Output==
  
    direction     - the vector giving the BFGS approximation to the search direction
+
    direction       - LBFGS approximation to the  
 +
                      search direction
  
 
==Notes==
 
==Notes==
The L-BFGS algorithm is the default of [[fminnewton.m]], and should be considered a good mix of computational efficiency and fast convergence.
+
The L-BFGS algorithm is the default of [[fminnewton.m]], and is a good mix of computational efficiency and fast convergence.
  
 
==See also==
 
==See also==
[[quasinewton.m]], [[fminnewton.m]], [[optim_tols.m]]
+
[[fminnewton.m]], [[hessreg.m]], [[linesearch.m]]
  
  
''Revision 3284, authors: [[Ilya Kuprov]] [[David Goodwin]]''
+
''Version 2.2, authors: [[Ilya Kuprov]], [[David Goodwin]]''

Latest revision as of 17:27, 13 August 2018

Calculates an approximation to the Newton-Raphson search direction using past gradients to build a serviceable substitute to a Hessian. The Hessian matrix is never explicitly formed or inverted. This function is the implementation from section 4 of http://dx.doi.org/10.1090/S0025-5718-1980-0572855-7

Syntax

    direction=lbfgs(dx_hist,dg_hist,g)

Arguments

   dx_hist         - history of x increments, a stack 
                     of column vectors, from the latest
                     to the earliest

   dg_hist         - history of gradient increments,
                     a stack of column vectors, from 
                     the latest to the earliest
 
   g               - current gradient

Output

   direction       - LBFGS approximation to the 
                     search direction

Notes

The L-BFGS algorithm is the default of fminnewton.m, and is a good mix of computational efficiency and fast convergence.

See also

fminnewton.m, hessreg.m, linesearch.m


Version 2.2, authors: Ilya Kuprov, David Goodwin