LoveBrains  1.0.0
Public Types | Public Member Functions | List of all members
GANN::ANN Class Reference

Define what is a neural network. More...

#include <neural_net.h>

Public Types

enum  ActivationType {
  SIGMOID, THRESHOLD, CUSTOM, SIGMOID,
  THRESHOLD, CUSTOM
}
 Define the type of the activation function.
 
enum  ActivationType {
  SIGMOID, THRESHOLD, CUSTOM, SIGMOID,
  THRESHOLD, CUSTOM
}
 

Public Member Functions

 ANN (void) throw ()
 Constructor.
 
 ANN (std::vector< unsigned int > const &infos)
 Constructor. More...
 
 ~ANN (void) throw ()
 Destructor.
 
Matrix< double > const & getOutputs (void) const
 Get the matrix of outputs. More...
 
double getMinRandom (void) const throw ()
 Get the minimum value of the randomization range. More...
 
double getMaxRandom (void) const throw ()
 Get the maximum value of the randomization range. More...
 
std::vector< ANNLayer * > const & getLayers (void) const throw ()
 Get the vector that contains all the layers of the neural network. More...
 
std::vector< unsigned int > const & getInfos (void) const throw ()
 Get the topology of the neural network. More...
 
double getCrossingRate (void) const throw ()
 Get the crossing rate of the nerual network. More...
 
ANNLayer::FActivate getActivationFunction (void) const throw ()
 Get the activation function of the intern layers. More...
 
ANNLayer::FActivate getOutputsActivation (void) const throw ()
 Get the activation function of the output layer. More...
 
ActivationType getOutputType (void) const throw ()
 Get the activation function's type of the intern layers. More...
 
ActivationType getLayerType (void) const throw ()
 Get the activation function's type of the output layer. More...
 
void setRandom (double min, double max) throw ()
 Set the range of the randomization. More...
 
void setLayers (std::vector< ANNLayer * > const &layers) throw ()
 Set the vector of layers. More...
 
void setCrossingRate (double rate) throw ()
 Set the crossing rate of the neural network. More...
 
void setActivationFunction (ANNLayer::FActivate f, ActivationType type)
 Set the function pointer of the intern layers activation function. More...
 
void setOutputsActivation (ANNLayer::FActivate f, ActivationType type)
 Set the function pointer of the output layer's activation function. More...
 
ANNoperator= (ANN const &b)
 
void Create (std::vector< unsigned int > const &infos)
 Create a neural network. More...
 
void Activate (Matrix< double > const &inputs)
 Activate the neural network and set the matrix of outputs. More...
 
void Save (const char *path) const
 Save the neural network in JSON (using the librairy called "Jsoncpp"). More...
 
void Load (const char *path)
 Load the neural network from the JSON file (using the librairy called "Jsoncpp"). More...
 
 ANN (std::vector< unsigned int > const &infos)
 
Matrix< double > const & getOutputs (void) const
 
double getMinRandom (void) const throw ()
 
double getMaxRandom (void) const throw ()
 
std::vector< ANNLayer * > const & getLayers (void) const throw ()
 
std::vector< unsigned int > const & getInfos (void) const throw ()
 
double getCrossingRate (void) const throw ()
 
ANNLayer::FActivate getActivationFunction (void) const throw ()
 
ANNLayer::FActivate getOutputsActivation (void) const throw ()
 
ActivationType getOutputType (void) const throw ()
 
ActivationType getLayerType (void) const throw ()
 
void setRandom (double min, double max) throw ()
 
void setLayers (std::vector< ANNLayer * > const &layers) throw ()
 
void setCrossingRate (double rate) throw ()
 
void setActivationFunction (ANNLayer::FActivate f, ActivationType type)
 
void setOutputsActivation (ANNLayer::FActivate f, ActivationType type)
 
ANNoperator= (ANN const &b)
 
void Create (std::vector< unsigned int > const &infos)
 
void Activate (Matrix< double > const &inputs)
 
void Save (const char *path) const
 
void Load (const char *path)
 

Detailed Description

Define what is a neural network.

Constructor & Destructor Documentation

GANN::ANN::ANN ( std::vector< unsigned int > const &  infos)

Constructor.

Parameters
infos: Contains the topology of the neural network.

Member Function Documentation

void GANN::ANN::Activate ( Matrix< double > const &  inputs)

Activate the neural network and set the matrix of outputs.

Parameters
inputs: Contains the inputs for the neural network.
void GANN::ANN::Create ( std::vector< unsigned int > const &  infos)

Create a neural network.

Parameters
infos: Contains the topology of the neural network.
ANNLayer::FActivate GANN::ANN::getActivationFunction ( void  ) const
throw (
)

Get the activation function of the intern layers.

Returns
GANN::ANNLayer::FActivate
double GANN::ANN::getCrossingRate ( void  ) const
throw (
)

Get the crossing rate of the nerual network.

Returns
double
std::vector< unsigned int > const & GANN::ANN::getInfos ( void  ) const
throw (
)

Get the topology of the neural network.

Returns
std::vector<unsigned int> const&
std::vector< ANNLayer * > const & GANN::ANN::getLayers ( void  ) const
throw (
)

Get the vector that contains all the layers of the neural network.

Returns
std::vector<ANNLayer *> const&
ANN::ActivationType GANN::ANN::getLayerType ( void  ) const
throw (
)

Get the activation function's type of the output layer.

Returns
ANN::ActivationType
double GANN::ANN::getMaxRandom ( void  ) const
throw (
)

Get the maximum value of the randomization range.

Returns
double
double GANN::ANN::getMinRandom ( void  ) const
throw (
)

Get the minimum value of the randomization range.

Returns
double
Matrix< double > const & GANN::ANN::getOutputs ( void  ) const

Get the matrix of outputs.

Returns
GANN::Matrix<double> const&
ANNLayer::FActivate GANN::ANN::getOutputsActivation ( void  ) const
throw (
)

Get the activation function of the output layer.

Returns
GANN::ANNLayer::FActivate
ANN::ActivationType GANN::ANN::getOutputType ( void  ) const
throw (
)

Get the activation function's type of the intern layers.

Returns
ANN::ActivationType
void GANN::ANN::Load ( const char *  path)

Load the neural network from the JSON file (using the librairy called "Jsoncpp").

Parameters
path: the path to the input file.
void GANN::ANN::Save ( const char *  path) const

Save the neural network in JSON (using the librairy called "Jsoncpp").

Parameters
path: the path to the output file.
void GANN::ANN::setActivationFunction ( ANNLayer::FActivate  f,
ANN::ActivationType  type 
)

Set the function pointer of the intern layers activation function.

Parameters
f: Contains the function pointer.
type: Contains the type of the activation function.
void GANN::ANN::setCrossingRate ( double  rate)
throw (
)

Set the crossing rate of the neural network.

Parameters
rate: Contains the new crossing rate.
void GANN::ANN::setLayers ( std::vector< ANNLayer * > const &  layers)
throw (
)

Set the vector of layers.

Parameters
layers: Contains all the layers.
void GANN::ANN::setOutputsActivation ( ANNLayer::FActivate  f,
ANN::ActivationType  type 
)

Set the function pointer of the output layer's activation function.

Parameters
f: Contains the function pointer.
type: Contains the type of the activation function.
void GANN::ANN::setRandom ( double  min,
double  max 
)
throw (
)

Set the range of the randomization.

Parameters
min: the minimum value.
max: the maximum value.

The documentation for this class was generated from the following files: