Module Owl_neural_compiler.Make

Parameters

Signature

module Engine : sig ... end
module Neural : sig ... end

Naive compilation functions, need to pass in loss function

Shallow compilation functions, includes only gradient

val lr_scale_name : string

Deep compilation functions, includes gs, us, ps, ch, and new weights

val _find_input : Engine.graph -> string -> Engine.Shape.Type.arr option
val _unflatten_like : 'a array array -> 'b array -> 'b array array
val assign_learning_rate : Engine.graph -> Neural.Params.typ -> int -> unit

assign_learning_rate cgraph params step sets the learning rate of a graph built by compile_deep for optimisation step step, counting from 1. train calls it before every step; call it yourself when driving compile_deep directly, otherwise every step uses the rate of step 1.

val make_update_fun : Engine.graph -> unit -> unit
val _save_optimiser_state : Engine.graph -> Neural.Graph.network -> Neural.Checkpoint.state -> unit
val train : ?state:??? -> ?params:??? -> ?init_model:??? -> Neural.Graph.network -> Neural.Algodiff.t -> Neural.Optimise.Algodiff.t -> Neural.Optimise.Checkpoint.state

train ?state ?params ?init_model network x y trains a compiled copy of network. As with Graph.train, init_model (default true) initialises the weights first. To resume a run, pass the state it returned as ~state together with ~init_model:false; the optimiser state saved in it (gradient history, momentum, learning-rate caches) is restored too.

val model_inputs : ?optimise:??? -> ?batch_size:??? -> Neural.Graph.network -> Neural.Algodiff.t array -> Neural.Algodiff.t array
val model : ?optimise:??? -> ?batch_size:??? -> Neural.Graph.network -> Neural.Algodiff.t -> Neural.Algodiff.t