package owl-opt-lbfgs
Owl's Lbfgs Optimisation Module
Install
Dune Dependency
Authors
Maintainers
Sources
v0.0.1.tar.gz
sha256=2e35805a3479cb008133ebb768a8508cf9f46bc962a4c92a71dfdb11889b137e
md5=2c8d6a63757fc7f43217aa94d54909e8
doc/index.html
Owl Opt LBFGS Library
The entry point of this library is Owl_opt_lbfgs
. The workflow is similar to that described in Owl Opt.
This library is built ontop of L-BFGS-ocaml.
Installation
dune build @install
dune install
Example
module Prms = struct
type 'a t = {a: 'a; b: 'a} [@@deriving prms]
end
(* make an Lbfgs optimisation module for the parameter definition Prms *)
module O = Owl_opt_lbfgs.Make (Prms)
(* define the objective function *)
let f prms = Owl.Algodiff.D.Maths.(l2norm' (y - ((prms.a *@ x) + prms.b)))
(* define initial parameters *)
let prms0 = {a = Owl.Algodiff.D.Mat.gaussian 5 5; b = Owl.Algodiff.D.gaussian 5 1}
(* initialise an optimisation session *)
let s0 = O.init ~prms0 ~f ()
(* define stopping criteria: stop when function value is smaller than 1E-4 *)
let stop s = O.(fv s) < 1E-4
(* minimise objective function f *)
let s = O.min f
(* final objective function value *)
let c = O.fv s
(* final prms *)
let prms = O.prms s
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page