Module Owl_opt_lbfgs__.Bindings
type workRepresent the memory space needed to solve a minimization problem. It is usually allocated automatically but it is possible to do it manually to, say, allocate it once only before a loop.
exceptionAbnormal of float * stringAbnormal(f, msg)is raised if the routine terminated abnormally without being able to satisfy the termination conditions. In such an event, the variablex(seeF.min) will contain the current best approximation found andfis the value of the target function atx.msgis a message containing additional information (returned by the original FORTRAN code).If the error message is not precise enough, it is recommended to turn printing on to understand what is the problem.
type stateHolds informations on the current state of the computation that can help to decide whether to stop.
type vec= (float, Stdlib.Bigarray.float64_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.tVectors.
val min : ?factr:float -> ?pgtol:float -> work:work -> (vec -> vec -> float) -> vec -> vec -> lbfgs_statusmin f_df x dfminimises the functionfgiven byf_df.xis an initial estimate of the solution vector. On termination,xwill contain the next approximation found anddfwill contain the latest gradient.min f_df x dfshould be called iteratively to find the minimum off.f_df x dfis a function that computes f(x) and its gradiant f'(x), returns f(x) and stores f'(x) indf. Thexpassed tof_df x dfis physically equal to thexgiven inmin f_df x. Can raiseAbnormal.- 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.factrto1e12for low accuracy,1e7for moderate accuracy and1e1for extremely high accuracy. Settingfactrto0.suppresses this termination test. Default:1e7.
- parameter pgtol
The iteration will stop when
max{ |proj g_i| : i = 0,..., n-1} <= pgtolwhereproj g_iis the ith component of the projected gradient. Settingpgtolto0.suppresses this termination test. Default:1e-5.
val max : ?factr:float -> ?pgtol:float -> work:work -> (vec -> vec -> float) -> vec -> vec -> lbfgs_statusmax f_df xmaximises the functionfgiven byf_df.xis an initial estimate of the solution vector. This function is provided for convenience and callsF.min to which the reader is referred for further explanations.
val start : ?corrections:int -> ?l:vec -> ?u:vec -> int -> workstart nallocate the work space for a problem of size at mostn.- parameter l
lower bound for each component of the vector
x. Setl.(i)toneg_infinityto indicate that no lower bound is desired. Default: no lower bounds.
- parameter u
upper bound for each component of the vector
x. Setu.(i)toinfinityto indicate that no upper bound is desired. Default: no upper bounds.
- parameter corrections
maximum number of variable metric corrections used to define the limited memory matrix. Values < 3 are not recommended, and large values of
correctionscan result in excessive computing time. The range 3 <=corrections<= 20 is recommended. Default:10. This value in calledMin L-BFGS-B debugging output.
val restart : work -> unitrestart staterestarts the L-BFGS-B optimization.