Struct liblbfgs_sys::lbfgs_parameter_t
source · [−]#[repr(C)]pub struct lbfgs_parameter_t {Show 16 fields
pub m: c_int,
pub epsilon: lbfgsfloatval_t,
pub past: c_int,
pub delta: lbfgsfloatval_t,
pub max_iterations: c_int,
pub linesearch: c_int,
pub max_linesearch: c_int,
pub min_step: lbfgsfloatval_t,
pub max_step: lbfgsfloatval_t,
pub ftol: lbfgsfloatval_t,
pub wolfe: lbfgsfloatval_t,
pub gtol: lbfgsfloatval_t,
pub xtol: lbfgsfloatval_t,
pub orthantwise_c: lbfgsfloatval_t,
pub orthantwise_start: c_int,
pub orthantwise_end: c_int,
}
Expand description
L-BFGS optimization parameters. Call lbfgs_parameter_init() function to initialize parameters to the default values.
Fields
m: c_int
The number of corrections to approximate the inverse hessian matrix. The L-BFGS routine stores the computation results of previous \ref 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 \c 6. Values less than \c 3 are not recommended. Large values will result in excessive computing time.
epsilon: lbfgsfloatval_t
Epsilon for convergence test. This parameter determines the accuracy with which the solution is to be found. A minimization terminates when ||g|| < \ref epsilon * max(1, ||x||), where ||.|| denotes the Euclidean (L2) norm. The default value is \c 1e-5.
past: c_int
Distance for delta-based convergence test. This parameter determines the distance, in iterations, to compute the rate of decrease of the objective function. If the value of this parameter is zero, the library does not perform the delta-based convergence test. The default value is \c 0.
delta: lbfgsfloatval_t
Delta for convergence test. This parameter determines the minimum rate of decrease of the objective function. The library stops iterations when the following condition is met: (f’ - f) / f < \ref delta, where f’ is the objective value of \ref past iterations ago, and f is the objective value of the current iteration. The default value is \c 1e-5.
max_iterations: c_int
The maximum number of iterations. The lbfgs() function terminates an optimization process with ::LBFGSERR_MAXIMUMITERATION status code when the iteration count exceedes this parameter. Setting this parameter to zero continues an optimization process until a convergence or error. The default value is \c 0.
linesearch: c_int
The line search algorithm. This parameter specifies a line search algorithm to be used by the L-BFGS routine.
max_linesearch: c_int
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 \c 40.
min_step: lbfgsfloatval_t
The minimum step of the line search routine. The default value is \c 1e-20. This value need not be modified unless the exponents are too large for the machine being used, or unless the problem is extremely badly scaled (in which case the exponents should be increased).
max_step: lbfgsfloatval_t
The maximum step of the line search. The default value is \c 1e+20. This value need not be modified unless the exponents are too large for the machine being used, or unless the problem is extremely badly scaled (in which case the exponents should be increased).
ftol: lbfgsfloatval_t
A parameter to control the accuracy of the line search routine. The default value is \c 1e-4. This parameter should be greater than zero and smaller than \c 0.5.
wolfe: lbfgsfloatval_t
A coefficient for the Wolfe condition. This parameter is valid only when the backtracking line-search algorithm is used with the Wolfe condition, ::LBFGS_LINESEARCH_BACKTRACKING_STRONG_WOLFE or ::LBFGS_LINESEARCH_BACKTRACKING_WOLFE . The default value is \c 0.9. This parameter should be greater the \ref ftol parameter and smaller than \c 1.0.
gtol: lbfgsfloatval_t
A parameter to control the accuracy of the line search routine. The default value is \c 0.9. If the function and gradient evaluations are inexpensive with respect to the cost of the iteration (which is sometimes the case when solving very large problems) it may be advantageous to set this parameter to a small value. A typical small value is \c 0.1. This parameter shuold be greater than the \ref ftol parameter (\c 1e-4) and smaller than \c 1.0.
xtol: lbfgsfloatval_t
The machine precision for floating-point values. This parameter must be a positive value set by a client program to estimate the machine precision. The line search routine will terminate with the status code (::LBFGSERR_ROUNDING_ERROR) if the relative width of the interval of uncertainty is less than this parameter.
orthantwise_c: lbfgsfloatval_t
Coeefficient for the L1 norm of variables. This parameter should be set to zero for standard minimization problems. Setting this parameter to a positive value activates Orthant-Wise Limited-memory Quasi-Newton (OWL-QN) method, which minimizes the objective function F(x) combined with the L1 norm |x| of the variables, {F(x) + C |x|}. This parameter is the coeefficient for the |x|, i.e., C. As the L1 norm |x| is not differentiable at zero, the library modifies function and gradient evaluations from a client program suitably; a client program thus have only to return the function value F(x) and gradients G(x) as usual. The default value is zero.
orthantwise_start: c_int
Start index for computing L1 norm of the variables. This parameter is valid only for OWL-QN method (i.e., \ref orthantwise_c != 0). This parameter b (0 <= b < N) specifies the index number from which the library computes the L1 norm of the variables x, |x| := |x_{b}| + |x_{b+1}| + … + |x_{N}| . In other words, variables x_1, …, x_{b-1} are not used for computing the L1 norm. Setting b (0 < b < N), one can protect variables, x_1, …, x_{b-1} (e.g., a bias term of logistic regression) from being regularized. The default value is zero.
orthantwise_end: c_int
End index for computing L1 norm of the variables. This parameter is valid only for OWL-QN method (i.e., \ref orthantwise_c != 0). This parameter e (0 < e <= N) specifies the index number at which the library stops computing the L1 norm of the variables x,
Trait Implementations
sourceimpl Clone for lbfgs_parameter_t
impl Clone for lbfgs_parameter_t
sourcefn clone(&self) -> lbfgs_parameter_t
fn clone(&self) -> lbfgs_parameter_t
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for lbfgs_parameter_t
impl Debug for lbfgs_parameter_t
impl Copy for lbfgs_parameter_t
Auto Trait Implementations
impl RefUnwindSafe for lbfgs_parameter_t
impl Send for lbfgs_parameter_t
impl Sync for lbfgs_parameter_t
impl Unpin for lbfgs_parameter_t
impl UnwindSafe for lbfgs_parameter_t
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more