Module Lbfgs_s.Make

Parameters

Signature

type 'a t

user-defined record type

type fv = Owl.Algodiff.S.t

objective function value type

type prm = Owl.Algodiff.S.t

paramter type

type prms = prm t

user-defined paramter record type

type f = int -> prms -> fv

objective function type

type state

internal state

type status =
| Stop of float
| Continue of float

status

type stop = float -> state -> bool

stopping criterion function type

val iter : state -> int

iter s returns the number of iterations for optimisation state s

val prms : state -> prms

prms s returns the optimisation parameters of state s

val prev_fv : state -> float

prev_fv s returns the last objective function value of state s

val fv_hist : state -> float list

fv_hist s returns the history of the objective function values of state s up to the last objective function value (i.e., prev_f s is the same as List.hd (fv_hist s))

val init : ?⁠corrections:int -> prms0:prms -> unit -> state

init ?corrections ~prms0 () returns an initialises optimisation state for initial parmaters prms0

val min : ?⁠pgtol:float -> ?⁠factr:float -> ?⁠stop:stop -> f:f -> state -> float

min ~f state minimises f with respect to the state s

parameter factr

tolerance in the termination test for the algorithm. The iteration will stop when (f^k - f^{k+1})/max{ |f^k|, |f^{k+1}|, 1} <= factr*epsilon_float. Set e.g. factr to 1e12 for low accuracy, 1e7 for moderate accuracy and 1e1 for extremely high accuracy. Setting factr to 0. suppresses this termination test. Default: 1e7.

parameter pgtol

The iteration will stop when max{ |proj g_i| : i = 0,..., n-1} <= pgtol where proj g_i is the ith component of the projected gradient. Setting pgtol to 0. suppresses this termination test. Default: 1e-5.

parameter stop

An user-provided stopping criterion that terminates the optimization where stop fv s is true.

val max : ?⁠pgtol:float -> ?⁠factr:float -> ?⁠stop:stop -> f:f -> state -> float

max ~f state is the same as min, but maximises f