The generic L-BFGS optimizer, which uses a back-tracking line search algorithm to minimize a function.
More...
|
| | L_BFGS (const size_t numBasis=10, const size_t maxIterations=10000, const double armijoConstant=1e-4, const double wolfe=0.9, const double minGradientNorm=1e-6, const double factr=1e-15, const size_t maxLineSearchTrials=50, const double minStep=1e-20, const double maxStep=1e20) |
| | Initialize the L-BFGS object. More...
|
| |
| double | ArmijoConstant () const |
| | Get the Armijo condition constant. More...
|
| |
| double & | ArmijoConstant () |
| | Modify the Armijo condition constant. More...
|
| |
| double | Factr () const |
| | Get the factr value. More...
|
| |
| double & | Factr () |
| | Modify the factr value. More...
|
| |
| size_t | MaxIterations () const |
| | Get the maximum number of iterations. More...
|
| |
| size_t & | MaxIterations () |
| | Modify the maximum number of iterations. More...
|
| |
| size_t | MaxLineSearchTrials () const |
| | Get the maximum number of line search trials. More...
|
| |
| size_t & | MaxLineSearchTrials () |
| | Modify the maximum number of line search trials. More...
|
| |
| double | MaxStep () const |
| | Return the maximum line search step size. More...
|
| |
| double & | MaxStep () |
| | Modify the maximum line search step size. More...
|
| |
| double | MinGradientNorm () const |
| | Get the minimum gradient norm. More...
|
| |
| double & | MinGradientNorm () |
| | Modify the minimum gradient norm. More...
|
| |
| const std::pair< arma::mat, double > & | MinPointIterate () const |
| | Return the point where the lowest function value has been found. More...
|
| |
| double | MinStep () const |
| | Return the minimum line search step size. More...
|
| |
| double & | MinStep () |
| | Modify the minimum line search step size. More...
|
| |
| size_t | NumBasis () const |
| | Get the memory size. More...
|
| |
| size_t & | NumBasis () |
| | Modify the memory size. More...
|
| |
|
| double | Optimize (FunctionType &function, arma::mat &iterate) |
| | Use L-BFGS to optimize the given function, starting at the given iterate point and finding the minimum. More...
|
| |
| double | Wolfe () const |
| | Get the Wolfe parameter. More...
|
| |
| double & | Wolfe () |
| | Modify the Wolfe parameter. More...
|
| |
The generic L-BFGS optimizer, which uses a back-tracking line search algorithm to minimize a function.
The parameters for the algorithm (number of memory points, maximum step size, and so forth) are all configurable via either the constructor or standalone modifier functions. A function which can be optimized by this class's Optimize() method must implement the following methods:
- a default constructor
- double Evaluate(const arma::mat& coordinates);
- void Gradient(const arma::mat& coordinates, arma::mat& gradient);
- arma::mat& GetInitialPoint();
Definition at line 35 of file lbfgs.hpp.
| double Optimize |
( |
FunctionType & |
function, |
|
|
arma::mat & |
iterate |
|
) |
| |
Use L-BFGS to optimize the given function, starting at the given iterate point and finding the minimum.
The maximum number of iterations is set in the constructor (or with MaxIterations()). Alternately, another overload is provided which takes a maximum number of iterations as a parameter. The given starting point will be modified to store the finishing point of the algorithm, and the final objective value is returned.
- Template Parameters
-
| FunctionType | Type of the function to be optimized. |
- Parameters
-
| function | Function to optimize; must have Evaluate() and Gradient(). |
| iterate | Starting point (will be modified). |
- Returns
- Objective value of the final point.