[][src]Struct liblbfgs::LBFGS

pub struct LBFGS<F> where
    F: FnMut(&[f64], &mut [f64]) -> Result<f64>, 
{ pub param: LbfgsParam, // some fields omitted }

Fields

param: LbfgsParam

Methods

impl<F> LBFGS<F> where
    F: FnMut(&[f64], &mut [f64]) -> Result<f64>, 
[src]

Create lbfgs optimizer with epsilon convergence

pub fn with_epsilon(self, epsilon: f64) -> Self[src]

Set scaled gradient norm for converence test

This parameter determines the accuracy with which the solution is to be found. A minimization terminates when

||g|| < epsilon * max(1, ||x||),

where ||.|| denotes the Euclidean (L2) norm. The default value is 1e-5.

pub fn with_initial_step_size(self, b: f64) -> Self[src]

Set initial step size for optimization. The default value is 1.0.

pub fn with_max_step_size(self, s: f64) -> Self[src]

Set the maximum allowed step size for optimization. The default value is 1.0.

pub fn with_damping(self, damped: bool) -> Self[src]

Enable Powell damping.

pub fn with_orthantwise(self, c: f64, start: usize, end: usize) -> Self[src]

Set orthantwise parameters

pub fn with_linesearch_ftol(self, ftol: f64) -> Self[src]

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 than 0.5.

pub fn with_linesearch_gtol(self, gtol: f64) -> Self[src]

A parameter to control the accuracy of the line search routine.

The default value is 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 0.1. This parameter shuold be greater than the ftol parameter (1e-4) and smaller than 1.0.

pub fn with_gradient_only(self) -> Self[src]

Try to follow gradient only during optimization, by allowing object value rises, which removes the sufficient decrease condition constrain in line search. This option also implies Powell damping and BacktrackingStrongWolfe line search for improving robustness.

pub fn with_max_linesearch(self, n: usize) -> Self[src]

Set the max number of iterations for line search.

pub fn with_linesearch_xtol(self, xtol: f64) -> Self[src]

xtol is a nonnegative input variable. termination occurs when the relative width of the interval of uncertainty is at most xtol.

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.

pub fn with_linesearch_min_step(self, min_step: f64) -> Self[src]

The minimum step of the line search routine.

The default value is 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).

pub fn with_max_iterations(self, niter: usize) -> Self[src]

Set the maximum number of iterations.

The lbfgs optimization terminates 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 0.

pub fn with_max_evaluations(self, neval: usize) -> Self[src]

The maximum allowed number of evaluations of function value and gradients. This number could be larger than max_iterations since line search procedure may involve one or more evaluations.

Setting this parameter to zero continues an optimization process until a convergence or error. The default value is 0.

pub fn with_fx_delta(self, delta: f64, past: usize) -> Self[src]

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 < delta, where f' is the objective value of past iterations ago, and f is the objective value of the current iteration.

If past is zero, the library does not perform the delta-based convergence test.

The default value of delta is 1e-5.

pub fn with_linesearch_algorithm(self, algo: &str) -> Self[src]

Select line search algorithm

The default is "MoreThuente" line search algorithm.

impl<F> LBFGS<F> where
    F: FnMut(&[f64], &mut [f64]) -> Result<f64>, 
[src]

pub fn minimize<'a, G>(
    self,
    x: &'a mut [f64],
    eval_fn: F,
    prgr_fn: G
) -> Result<Problem<'a, F>> where
    G: FnMut(&Progress) -> bool
[src]

Start the L-BFGS optimization; this will invoke the callback functions evaluate and progress.

Parameters

  • x : The array of input variables.
  • evaluate: A closure for evaluating function value and gradient
  • progress: A closure for monitor progress or defining stopping condition

Return

  • on success, return final evaluated Problem.

Trait Implementations

impl<F: Clone> Clone for LBFGS<F> where
    F: FnMut(&[f64], &mut [f64]) -> Result<f64>, 
[src]

impl<F: Debug> Debug for LBFGS<F> where
    F: FnMut(&[f64], &mut [f64]) -> Result<f64>, 
[src]

impl<F> Default for LBFGS<F> where
    F: FnMut(&[f64], &mut [f64]) -> Result<f64>, 
[src]

Auto Trait Implementations

impl<F> RefUnwindSafe for LBFGS<F> where
    F: RefUnwindSafe

impl<F> Send for LBFGS<F> where
    F: Send

impl<F> Sync for LBFGS<F> where
    F: Sync

impl<F> Unpin for LBFGS<F> where
    F: Unpin

impl<F> UnwindSafe for LBFGS<F> where
    F: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.