Darwin Neuroevolution Framework
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Enumerations | Functions | Variables
ann Namespace Reference

Artificial Neural Networks (ANN) building blocks. More...

Classes

struct  Config
 The ANN library configuration. More...
 

Enumerations

enum  ActivationFunction {
  ActivationFunction::Identity,
  ActivationFunction::Logistic,
  ActivationFunction::Tanh,
  ActivationFunction::ReLU,
  ActivationFunction::Neat,
  ActivationFunction::ReExp,
  ActivationFunction::LogisticEx
}
 The types of supported activation functions. More...
 

Functions

void setActivationFunction (ActivationFunction afn)
 Selects the activation function.
 
void setGateActivationFunction (ActivationFunction afn)
 Selects the gate activation function (used with ANNs which include gates, for example LSTM)
 
float activate (float x)
 Applies the selected activation function. More...
 
float activateGate (float x)
 Applies the selected gate activation function. More...
 
float afnIdentity (float x)
 Identity function.
 
float afnLogistic (float x)
 Standard logistic function.
 
float afnTanh (float x)
 tanh
 
float afnReLU (float x)
 ReLU.
 
float afnNeat (float x)
 Classic NEAT activation function.
 
float afnReExp (float x)
 Experimental: ReExp. More...
 
float afnLogisticEx (float x)
 Experimental: Yet another sigmoid function. More...
 
template<class T >
void reset (std::vector< T > &v)
 Reset the values in a vector to 0.
 
void reset (Matrix &matrix)
 Reset the values in a Matrix.
 
void activateLayer (vector< float > &out)
 Apply the activation function over a set of values. More...
 
void randomize (Matrix &w)
 Randomize the values in a Matrix. More...
 
float roundWeight (float w)
 Ajust a value by rounding to Config::connection_resolution.
 
template<class T , class RND >
void mutateValue (T &value, RND &rnd, T std_dev)
 Mutate a value. More...
 

Variables

EvaluateLayer evaluateLayer = nullptr
 Evaluate a fully connected layer.
 

Detailed Description

Artificial Neural Networks (ANN) building blocks.

Enumeration Type Documentation

◆ ActivationFunction

The types of supported activation functions.

Note
Consider adding new activation functions to cgp::FunctionId as well
Enumerator
Identity 

Identity.

Logistic 

Logistic.

Tanh 

Hyperbolic tangent (tanh)

ReLU 

ReLU.

Neat 

NEAT activation function.

ReExp 

Experimental.

LogisticEx 

Experimental.

Function Documentation

◆ activate()

float ann::activate ( float  x)
inline

Applies the selected activation function.

See also
setActivationFunction

◆ activateGate()

float ann::activateGate ( float  x)
inline

Applies the selected gate activation function.

See also
setGateActivationFunction

◆ activateLayer()

void ann::activateLayer ( vector< float > &  out)
inline

Apply the activation function over a set of values.

See also
ann::activate()

◆ afnLogisticEx()

float ann::afnLogisticEx ( float  x)
inline

Experimental: Yet another sigmoid function.

◆ afnReExp()

float ann::afnReExp ( float  x)
inline

Experimental: ReExp.

◆ mutateValue()

template<class T , class RND >
void ann::mutateValue ( T &  value,
RND &  rnd,
std_dev 
)

◆ randomize()

void ann::randomize ( Matrix w)
inline

Randomize the values in a Matrix.