LoveBrains
1.0.0
|
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... | |
ANN & | operator= (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) |
ANN & | operator= (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) |
Define what is a neural network.
GANN::ANN::ANN | ( | std::vector< unsigned int > const & | infos | ) |
Constructor.
infos | : Contains the topology of the neural network. |
void GANN::ANN::Activate | ( | Matrix< double > const & | inputs | ) |
Activate the neural network and set the matrix of outputs.
inputs | : Contains the inputs for the neural network. |
void GANN::ANN::Create | ( | std::vector< unsigned int > const & | infos | ) |
Create a neural network.
infos | : Contains the topology of the neural network. |
ANNLayer::FActivate GANN::ANN::getActivationFunction | ( | void | ) | const | |
throw | ( | ||||
) |
Get the activation function of the intern layers.
double GANN::ANN::getCrossingRate | ( | void | ) | const | |
throw | ( | ||||
) |
Get the crossing rate of the nerual network.
std::vector< unsigned int > const & GANN::ANN::getInfos | ( | void | ) | const | |
throw | ( | ||||
) |
Get the topology of the neural network.
std::vector< ANNLayer * > const & GANN::ANN::getLayers | ( | void | ) | const | |
throw | ( | ||||
) |
Get the vector that contains all the layers of the neural network.
ANN::ActivationType GANN::ANN::getLayerType | ( | void | ) | const | |
throw | ( | ||||
) |
Get the activation function's type of the output layer.
double GANN::ANN::getMaxRandom | ( | void | ) | const | |
throw | ( | ||||
) |
Get the maximum value of the randomization range.
double GANN::ANN::getMinRandom | ( | void | ) | const | |
throw | ( | ||||
) |
Get the minimum value of the randomization range.
Matrix< double > const & GANN::ANN::getOutputs | ( | void | ) | const |
Get the matrix of outputs.
ANNLayer::FActivate GANN::ANN::getOutputsActivation | ( | void | ) | const | |
throw | ( | ||||
) |
Get the activation function of the output layer.
ANN::ActivationType GANN::ANN::getOutputType | ( | void | ) | const | |
throw | ( | ||||
) |
Get the activation function's type of the intern layers.
void GANN::ANN::Load | ( | const char * | path | ) |
Load the neural network from the JSON file (using the librairy called "Jsoncpp").
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").
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.
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.
rate | : Contains the new crossing rate. |
void GANN::ANN::setLayers | ( | std::vector< ANNLayer * > const & | layers | ) | |
throw | ( | ||||
) |
Set the vector of layers.
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.
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.
min | : the minimum value. |
max | : the maximum value. |