Module Neuron.Activation

type typ =
  1. | Elu
  2. | Relu
  3. | Sigmoid
  4. | HardSigmoid
  5. | Softmax of int
  6. | Softplus
  7. | Softsign
  8. | Tanh
  9. | Relu6
  10. | LeakyRelu of float
  11. | TRelu of float
  12. | Custom of Optimise.Algodiff.t -> Optimise.Algodiff.t
  13. | None
    (*

    Types of activation functions.

    *)
type neuron_typ = {
  1. mutable activation : typ;
  2. mutable in_shape : int array;
  3. mutable out_shape : int array;
}

Neuron type definition.

val create : typ -> neuron_typ

Create the neuron.

val connect : int array -> neuron_typ -> unit

Connect this neuron to others in a neural network.

val run_activation : Optimise.Algodiff.t -> typ -> Optimise.Algodiff.t

Run one specific activation function.

val copy : neuron_typ -> neuron_typ

Make a deep copy of the neuron and its parameters.

Execute the computation in this neuron.

val activation_to_string : typ -> string

Return the name of a specific activation function.

val to_string : neuron_typ -> string

Convert the neuron to its string representation. The string is often a summary of the parameters defined in the neuron.

val to_name : unit -> string

Return the name of the neuron.