Module Gd_d.Make
Parameters
Signature
type status= Owl_opt__.Status.t=|Continue of float|Stop of floatoptimization status
type stop= float -> state -> boolstopping criterion function type
val iter : state -> intiter sreturns the number of iterations for optimisation states
val prev_fv : state -> floatprev_fv sreturns the last objective function value of states
val fv_hist : state -> float listfv_hist sreturns the history of the objective function values of statesup to the last objective function value (i.e.,prev_f sis the same asList.hd (fv_hist s))
val init : prms0:prms -> lr:Owl_opt.Lr.t -> unit -> stateinit ~prms0 ~lr ()initialises and returns optimisation state for initial parmatersprms0and learning ratelr
val stop : float -> state -> boolstop fv sis 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-3
val min_step : ?stop:stop -> f:f -> state -> statusmin_step ?(stop=stop) ~f scomputes the function valuefvof optimization stateswith parameters (i.e.,f (iter s) (prms s)returnsfv). If the stopping criterion is reached (i.e.stop fv sistrue), then returnStop fvand no optimization is performed. Otherwise, miniziefby updating the parameters ofsone step (in place) via gradient descent and returnsContinue fv. Here,stop fv sis a callback function that can be used to specify the termination criterion and print out intermediate function values.
val max_step : ?stop:stop -> f:f -> state -> statusmax_step ?(stop=stop) ~f ~lris similar tomin_stepbut maximises f.