Net.Layer
Layers of a net.
type t = {
inputs : int;
Number of inputs.
*)outputs : int;
Number of outputs.
*)forward : Vector.t -> Vector.t;
Forward computation.
*)backward : Vector.t -> Vector.t -> Vector.t;
Backward computation: given the input and the output gradient, update the weights and return the new gradient.
*)}
A layer.
val src : t -> int
val tgt : t -> int
Linear combination of the inputs.
Each output is an affine combination of all the inputs.
val activation : [< `ReLU | `Sigmoid ] -> int -> t
Apply an activation function on each input.
val softmax : int -> t
Apply the softmax function (to turn logits into probabilities).
val softmax_ce : int -> int -> t
Softmax followed by cross-entropy.
val tensor : t Extlib.List.t -> t
Tensor product of lines.