#[repr(C)]pub enum fann_activationfunc_enum {
Show 19 variants
FANN_NONE = -1,
FANN_LINEAR = 0,
FANN_THRESHOLD = 1,
FANN_THRESHOLD_SYMMETRIC = 2,
FANN_SIGMOID = 3,
FANN_SIGMOID_STEPWISE = 4,
FANN_SIGMOID_SYMMETRIC = 5,
FANN_SIGMOID_SYMMETRIC_STEPWISE = 6,
FANN_GAUSSIAN = 7,
FANN_GAUSSIAN_SYMMETRIC = 8,
FANN_GAUSSIAN_STEPWISE = 9,
FANN_ELLIOTT = 10,
FANN_ELLIOTT_SYMMETRIC = 11,
FANN_LINEAR_PIECE = 12,
FANN_LINEAR_PIECE_SYMMETRIC = 13,
FANN_SIN_SYMMETRIC = 14,
FANN_COS_SYMMETRIC = 15,
FANN_SIN = 16,
FANN_COS = 17,
}
Expand description
The activation functions used for the neurons during training. The activation functions
can either be defined for a group of neurons by fann_set_activation_function_hidden
and
fann_set_activation_function_output
, or it can be defined for a single neuron by
fann_set_activation_function
.
The steepness of an activation function is defined in the same way by
fann_set_activation_steepness_hidden
, fann_set_activation_steepness_output
and
fann_set_activation_steepness
.
The functions are described with functions where:
-
x is the input to the activation function,
-
y is the output,
-
s is the steepness and
-
d is the derivation.
Variants§
FANN_NONE = -1
Neuron does not exist or does not have an activation function.
FANN_LINEAR = 0
Linear activation function.
-
span: -inf < y < inf
-
y = xs, d = 1s
-
Can NOT be used in fixed point.
FANN_THRESHOLD = 1
Threshold activation function.
-
x < 0 -> y = 0, x >= 0 -> y = 1
-
Can NOT be used during training.
FANN_THRESHOLD_SYMMETRIC = 2
Threshold activation function.
-
x < 0 -> y = 0, x >= 0 -> y = 1
-
Can NOT be used during training.
FANN_SIGMOID = 3
Sigmoid activation function.
-
One of the most used activation functions.
-
span: 0 < y < 1
-
y = 1/(1 + exp(-2sx))
-
d = 2sy*(1 - y)
FANN_SIGMOID_STEPWISE = 4
Stepwise linear approximation to sigmoid.
- Faster than sigmoid but a bit less precise.
FANN_SIGMOID_SYMMETRIC = 5
Symmetric sigmoid activation function, aka. tanh.
-
One of the most used activation functions.
-
span: -1 < y < 1
-
y = tanh(sx) = 2/(1 + exp(-2s*x)) - 1
-
d = s*(1-(y*y))
FANN_SIGMOID_SYMMETRIC_STEPWISE = 6
Stepwise linear approximation to symmetric sigmoid.
- Faster than symmetric sigmoid but a bit less precise.
FANN_GAUSSIAN = 7
Gaussian activation function.
-
0 when x = -inf, 1 when x = 0 and 0 when x = inf
-
span: 0 < y < 1
-
y = exp(-xsx*s)
-
d = -2xsys
FANN_GAUSSIAN_SYMMETRIC = 8
Symmetric gaussian activation function.
-
-1 when x = -inf, 1 when x = 0 and 0 when x = inf
-
span: -1 < y < 1
-
y = exp(-xsx*s)*2-1
-
d = -2xs*(y+1)*s
FANN_GAUSSIAN_STEPWISE = 9
Stepwise linear approximation to gaussian. Faster than gaussian but a bit less precise. NOT implemented yet.
FANN_ELLIOTT = 10
Fast (sigmoid like) activation function defined by David Elliott
-
span: 0 < y < 1
-
y = ((xs) / 2) / (1 + |xs|) + 0.5
-
d = s1/(2(1+|xs|)(1+|x*s|))
FANN_ELLIOTT_SYMMETRIC = 11
Fast (symmetric sigmoid like) activation function defined by David Elliott
-
span: -1 < y < 1
-
y = (xs) / (1 + |xs|)
-
d = s1/((1+|xs|)(1+|xs|))
FANN_LINEAR_PIECE = 12
Bounded linear activation function.
-
span: 0 <= y <= 1
-
y = xs, d = 1s
FANN_LINEAR_PIECE_SYMMETRIC = 13
Bounded linear activation function.
-
span: -1 <= y <= 1
-
y = xs, d = 1s
FANN_SIN_SYMMETRIC = 14
Periodical sine activation function.
-
span: -1 <= y <= 1
-
y = sin(x*s)
-
d = scos(xs)
FANN_COS_SYMMETRIC = 15
Periodical cosine activation function.
-
span: -1 <= y <= 1
-
y = cos(x*s)
-
d = s*-sin(x*s)
FANN_SIN = 16
Periodical sine activation function.
-
span: 0 <= y <= 1
-
y = sin(x*s)/2+0.5
-
d = scos(xs)/2
FANN_COS = 17
Periodical cosine activation function.
-
span: 0 <= y <= 1
-
y = cos(x*s)/2+0.5
-
d = s*-sin(x*s)/2
Trait Implementations§
source§impl Clone for fann_activationfunc_enum
impl Clone for fann_activationfunc_enum
source§fn clone(&self) -> fann_activationfunc_enum
fn clone(&self) -> fann_activationfunc_enum
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more