logo

Function neuronika::nn::init::calculate_gain[][src]

pub fn calculate_gain(non_linearity: &str) -> f32
Expand description

Returns the recommended gain value for the given non-linearity function.

Supported non-linearities are:

  • linear
  • sigmoid
  • tanh
  • relu
  • leaky_relu

Arguments

non_linearity - a non-linearity function’s name.

Panics

If non_linearity is not among those listed above.