Class LBFGSParam#
Defined in File lsparameters.hpp
Class Documentation#
-
class LBFGSParam#
Parameters to control the L-BFGS algorithm.
Public Functions
- inline LBFGSParam(
- int m_ = 6,
- Scalar epsilon_ = Scalar(1e-5),
- Scalar epsilon_rel_ = Scalar(1e-5),
- int past_ = 0,
- Scalar delta_ = Scalar(0),
- int max_linesearch_ = 200,
- Scalar min_step_ = Scalar(1e-20),
- Scalar max_step_ = Scalar(1e+20),
- Scalar ftol_ = Scalar(1e-4),
- Scalar wolfe_ = Scalar(0.9),
- int linesearch_ = LINESEARCH_BACKTRACKING_STRONG_WOLFE
Constructor for L-BFGS parameters.
Default values for parameters will be set when the object is created.
-
inline void check_param() const#
Checking the validity of L-BFGS parameters.
An
std::invalid_argumentexception will be thrown if some parameter is invalid.
Public Members
-
int m#
The number of corrections to approximate the inverse Hessian matrix.
The L-BFGS routine stores the computation results of previous m iterations to approximate the inverse Hessian matrix of the current iteration. This parameter controls the size of the limited memories (corrections). The default value is
6. Values less than3are not recommended. Large values will result in excessive computing time.
-
Scalar epsilon#
Absolute tolerance for convergence test.
This parameter determines the absolute accuracy \(\epsilon_{abs}\) with which the solution is to be found. A minimization terminates when \(||g|| < \max\{\epsilon_{abs}, \epsilon_{rel}||x||\}\), where \(||\cdot||\) denotes the Euclidean (L2) norm. The default value is
1e-5.
-
Scalar epsilon_rel#
Relative tolerance for convergence test.
This parameter determines the relative accuracy \(\epsilon_{rel}\) with which the solution is to be found. A minimization terminates when \(||g|| < \max\{\epsilon_{abs}, \epsilon_{rel}||x||\}\), where \(||\cdot||\) denotes the Euclidean (L2) norm. The default value is
1e-5.
-
int past#
Distance for delta-based convergence test.
This parameter determines the distance \(d\) to compute the rate of decrease of the objective function, \(f_{k-d}(x)-f_k(x)\), where \(k\) is the current iteration step. If the value of this parameter is zero, the delta-based convergence test will not be performed. The default value is
0.
-
Scalar delta#
Delta for convergence test.
The algorithm stops when the following condition is met, \(|f_{k-d}(x)-f_k(x)|<\delta\cdot\max(1, |f_k(x)|, |f_{k-d}(x)|)\), where \(f_k(x)\) is the current function value, and \(f_{k-d}(x)\) is the function value \(d\) iterations ago (specified by the past parameter). The default value is
0.
-
int max_iterations#
The maximum number of iterations.
The optimization process is terminated when the iteration count exceeds this parameter. Setting this parameter to zero continues an optimization process until a convergence or error. The default value is
0.
-
int max_linesearch#
The maximum number of trials for the line search.
This parameter controls the number of function and gradients evaluations per iteration for the line search routine. The default value is
20.
-
Scalar min_step#
The minimum step length allowed in the line search.
The default value is
1e-20. Usually this value does not need to be modified.
-
Scalar max_step#
The maximum step length allowed in the line search.
The default value is
1e+20. Usually this value does not need to be modified.
-
Scalar ftol#
A parameter to control the accuracy of the line search routine.
The default value is
1e-4. This parameter should be greater than zero and smaller than0.5.
-
Scalar wolfe#
The coefficient for the Wolfe condition.
This parameter is valid only when the line-search algorithm is used with the Wolfe condition. The default value is
0.9. This parameter should be greater the ftol parameter and smaller than1.0.
-
int linesearch#