package owl-opt

  1. Overview
  2. Docs

Module Gd.MakeSource

Parameters

module P : Prms.PT

Signature

objective function value type

paramter type

Sourcetype prms = prm P.t

user-defined paramter record type

Sourcetype f = prms -> fv

objective function type

Sourcetype state

internal state

Sourcetype stop = state -> bool

stopping criterion function type

Sourceval iter : state -> int

iter s returns the number of iterations for optimisation state s

Sourceval prms : state -> prms

prms s returns the optimisation parameters of state s

Sourceval f : state -> f

f s returns the objective function of state s

Sourceval fv : state -> float

fv s returns the objective function value of state s

Sourceval init : prms0:prms -> f:f -> unit -> state

init ~prms0 ~f () returns an initialises optimisation state for initial parmaters prms0 and objective function f

Sourceval stop : state -> bool

stop s is the default stopping criterion, which prints out the iteration and objective function value at each optimisation iteration and terminates when the objective function value goes below 1E-4

Sourceval min : ?stop:stop -> lr:Lr.t -> state -> state

min ?(stop=stop) ~lr s minimises f for optimisation state s using vanilla gradient descent. Once the stopping criterion is reached (i.e. stop s returns true), the min returns the optimised state.

Sourceval max : ?stop:stop -> lr:Lr.t -> state -> state

max ?(stop=stop) ?(beta=0.9) ~lr s is similar to min but maximises f.

OCaml

Innovation. Community. Security.