pub struct MoreThuenteLineSearch<P, G, F> { /* private fields */ }
Expand description

The More-Thuente line search is a method which finds an appropriate step length from a starting point and a search direction. This point obeys the strong Wolfe conditions.

With the method with_c the scaling factors for the sufficient decrease condition and the curvature condition can be supplied. By default they are set to c1 = 1e-4 and c2 = 0.9.

Bounds on the range where step lengths are being searched for can be set with with_bounds which accepts a lower and an upper bound. Both values need to be non-negative and lower < upper.

One of the reasons for the algorithm to terminate is when the the relative width of the uncertainty interval is smaller than a given tolerance (default: 1e-10). This tolerance can be set via with_width_tolerance and must be non-negative.

TODO: Add missing stopping criteria!

Requirements on the optimization problem

The optimization problem is required to implement CostFunction and Gradient.

References

This implementation follows the excellent MATLAB implementation of Dianne P. O’Leary at http://www.cs.umd.edu/users/oleary/software/

Jorge J. More and David J. Thuente. “Line search algorithms with guaranteed sufficient decrease.” ACM Trans. Math. Softw. 20, 3 (September 1994), 286-307. DOI: https://doi.org/10.1145/192115.192132

Implementations

Construct a new instance of MoreThuenteLineSearch

Example
let mtls: MoreThuenteLineSearch<Vec<f64>, Vec<f64>, f64> = MoreThuenteLineSearch::new();

Set the constants c1 and c2 for the sufficient decrease and curvature conditions, respectively. 0 < c1 < c2 < 1 must hold.

The default values are c1 = 1e-4 and c2 = 0.9.

Example
let mtls: MoreThuenteLineSearch<Vec<f64>, Vec<f64>, f64> =
    MoreThuenteLineSearch::new().with_c(1e-3, 0.8)?;

Set lower and upper bound of step

Defaults are step_min = sqrt(EPS) and step_max = INF.

step_min must be smaller than step_max.

Example
let mtls: MoreThuenteLineSearch<Vec<f64>, Vec<f64>, f64> =
    MoreThuenteLineSearch::new().with_bounds(1e-6, 10.0)?;

Set relative tolerance on width of uncertainty interval

The algorithm terminates when the relative width of the uncertainty interval is below the supplied tolerance.

Must be non-negative and defaults to 1e-10.

Example
let mtls: MoreThuenteLineSearch<Vec<f64>, Vec<f64>, f64> =
    MoreThuenteLineSearch::new().with_width_tolerance(1e-9)?;

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Set search direction

Set initial alpha value

Serialize this value into the given Serde serializer. Read more

Name of the solver. Mainly used in Observers.

Initializes the algorithm. Read more

Computes a single iteration of the algorithm and has access to the optimization problem definition and the internal state of the solver. Returns an updated state and optionally a KV which holds key-value pairs used in Observers. Read more

Checks whether basic termination reasons apply. Read more

Used to implement stopping criteria, in particular criteria which are not covered by (terminate_internal. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.