#[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

source§

fn clone(&self) -> fann_activationfunc_enum

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for fann_activationfunc_enum

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.