Module Owl_neural_graph

module Owl_neural_graph: sig .. end
Neural network: Graphical neural network

type node = {
   mutable id : int;
   mutable prev : node array;
   mutable next : node array;
   mutable neuron : Owl_neural_neuron.neuron;
   mutable output : Owl_neural_neuron.t option;
   mutable network : network;
}
type network = {
   mutable size : int;
   mutable root : node option;
   mutable topo : node array;
}
val topological_sort : 'a -> 'a option array
val bfs_iter : (node -> 'a) -> node list -> unit
val bfs_map : (node -> 'a) -> node list -> 'a array
val bfs_array : node list -> node array
val make_network : int ->
node option ->
node array -> network
val make_node : int ->
node array ->
node array ->
Owl_neural_neuron.neuron ->
Owl_neural_neuron.t option ->
network -> node
val get_root : network -> node
val get_network : node -> network
val collect_output : node array -> Owl_neural_neuron.t array
val connect_pair : node -> node -> unit
val connect_to_parents : node array -> node -> unit
val add_node : ?act_typ:Owl_neural_neuron.Activation.typ ->
network ->
node array -> node -> node
val init : network -> unit
val reset : network -> unit
val mktag : int -> network -> unit
val mkpar : network -> Owl_neural_neuron.t array array
val mkpri : network -> Owl_algodiff.S.t array array
val mkadj : network -> Owl_algodiff.S.t array array
val update : network -> Owl_algodiff.S.t array array -> unit
val run : Owl_neural_neuron.t -> network -> Owl_neural_neuron.t
val forward : network ->
Owl_neural_neuron.t -> Owl_neural_neuron.t * Owl_neural_neuron.t array array
val backward : network ->
Owl_algodiff.S.t ->
Owl_algodiff.S.t array array * Owl_algodiff.S.t array array
val input : int array -> node
val activation : Owl_neural_neuron.Activation.typ ->
node -> node
val linear : ?init_typ:Owl_neural_neuron.Init.typ ->
?act_typ:Owl_neural_neuron.Activation.typ ->
int -> node -> node
val linear_nobias : ?init_typ:Owl_neural_neuron.Init.typ ->
?act_typ:Owl_neural_neuron.Activation.typ ->
int -> node -> node
val recurrent : ?init_typ:Owl_neural_neuron.Init.typ ->
act_typ:Owl_neural_neuron.Activation.typ ->
int -> int -> node -> node
val lstm : int -> node -> node
val gru : int -> node -> node
val conv2d : ?padding:Owl_algodiff.S.padding ->
?act_typ:Owl_neural_neuron.Activation.typ ->
int array -> int array -> node -> node
val conv3d : ?padding:Owl_algodiff.S.padding ->
?act_typ:Owl_neural_neuron.Activation.typ ->
'a ->
int array -> int array -> node -> node
val fully_connected : ?init_typ:Owl_neural_neuron.Init.typ ->
?act_typ:Owl_neural_neuron.Activation.typ ->
int -> node -> node
val max_pool2d : ?padding:Owl_algodiff.S.padding ->
?act_typ:Owl_neural_neuron.Activation.typ ->
int array -> int array -> node -> node
val avg_pool2d : ?padding:Owl_algodiff.S.padding ->
?act_typ:Owl_neural_neuron.Activation.typ ->
int array -> int array -> node -> node
val dropout : float -> node -> node
val reshape : ?convert:bool -> int array -> node -> node
val flatten : ?convert:bool -> node -> node
val lambda : ?act_typ:Owl_neural_neuron.Activation.typ ->
(Owl_neural_neuron.t -> Owl_neural_neuron.t) ->
node -> node
val add : ?act_typ:Owl_neural_neuron.Activation.typ ->
node array -> node
val mul : ?act_typ:Owl_neural_neuron.Activation.typ ->
node array -> node
val max : ?act_typ:Owl_neural_neuron.Activation.typ ->
node array -> node
val average : ?act_typ:Owl_neural_neuron.Activation.typ ->
node array -> node
val to_string : network -> string
val print : network -> unit
val save : 'a -> string -> unit
val load : string -> network
val train_generic : ?params:Owl_neural_optimise.Params.typ ->
?init_model:bool ->
network ->
Owl_algodiff.S.t -> Owl_algodiff.S.t -> Owl_algodiff.S.elt array
val train : ?params:Owl_neural_optimise.Params.typ ->
?init_model:bool ->
network ->
Owl_algodiff.S.mat -> Owl_algodiff.S.mat -> Owl_algodiff.S.elt array
val train_cnn : ?params:Owl_neural_optimise.Params.typ ->
?init_model:bool ->
network ->
Owl_algodiff.S.arr -> Owl_algodiff.S.mat -> Owl_algodiff.S.elt array