12 # define NEURAL_NET_H_
14 # include "ANN/ann_layer.h"
15 # include "ANN/ann_exception.h"
16 # include "json/json.h"
40 ANN(
std::vector<
unsigned int> const& infos);
74 std::vector<
unsigned int> const&
getInfos(
void) const throw();
110 void setRandom(
double min,
double max) throw();
137 ANN& operator=(
ANN const& b);
147 void Create(
std::vector<
unsigned int> const& infos);
157 void Save(const
char *path) const;
162 void Load(const
char *path);
170 ANNLayer::FActivate _out_activation;
171 ANNLayer::FActivate _layer_activation;
172 std::vector<
unsigned int> _infos;
183 void SaveInfos(
Json::Value& ann) const throw();
188 void SaveRandomize(
Json::Value& ann) const throw();
193 void SaveOutputActivation(
Json::Value& ann) const throw();
198 void SaveLayerActivation(
Json::Value& ann) const throw();
204 void SaveLayers(
Json::Value& ann) const;
211 void LoadInfos(
Json::Value const& ann) throw();
216 void LoadGenerateInfos(
Json::Value const& ann) throw();
221 void LoadOutputActivation(
Json::Value const& ann) throw();
226 void LoadLayerActivation(
Json::Value const& ann) throw();
232 void LoadLayers(
Json::Value const& ann);
std::vector< ANNLayer * > const & getLayers(void) const
Get the vector that contains all the layers of the neural network.
Definition: neural_net.cc:78
double getMaxRandom(void) const
Get the maximum value of the randomization range.
Definition: neural_net.cc:73
ANNLayer::FActivate getActivationFunction(void) const
Get the activation function of the intern layers.
Definition: neural_net.cc:93
void setRandom(double min, double max)
Set the range of the randomization.
Definition: neural_net.cc:116
std::vector< unsigned int > const & getInfos(void) const
Get the topology of the neural network.
Definition: neural_net.cc:83
void setActivationFunction(ANNLayer::FActivate f, ActivationType type)
Set the function pointer of the intern layers activation function.
Definition: neural_net.cc:142
ANNLayer::FActivate getOutputsActivation(void) const
Get the activation function of the output layer.
Definition: neural_net.cc:98
double getCrossingRate(void) const
Get the crossing rate of the nerual network.
Definition: neural_net.cc:88
void setCrossingRate(double rate)
Set the crossing rate of the neural network.
Definition: neural_net.cc:131
void Save(const char *path) const
Save the neural network in JSON (using the librairy called "Jsoncpp").
Definition: neural_net_save.cc:106
ActivationType getLayerType(void) const
Get the activation function's type of the output layer.
Definition: neural_net.cc:108
double getMinRandom(void) const
Get the minimum value of the randomization range.
Definition: neural_net.cc:68
void setOutputsActivation(ANNLayer::FActivate f, ActivationType type)
Set the function pointer of the output layer's activation function.
Definition: neural_net.cc:150
Define a layer of a neural network.
Definition: ann_layer.h:22
JSON (JavaScript Object Notation).
Definition: json-forwards.h:172
Define what is a neural network.
Definition: neural_net.h:24
ANN(void)
Constructor.
Definition: neural_net.cc:23
Matrix< double > const & getOutputs(void) const
Get the matrix of outputs.
Definition: neural_net.cc:60
void Create(std::vector< unsigned int > const &infos)
Create a neural network.
Definition: neural_net.cc:207
Contains all the objects that provide the management for the genetic algorithm with neural networks...
Definition: ann_exception.h:16
void Load(const char *path)
Load the neural network from the JSON file (using the librairy called "Jsoncpp"). ...
Definition: neural_net_load.cc:136
ActivationType
Define the type of the activation function.
Definition: neural_net.h:30
ActivationType getOutputType(void) const
Get the activation function's type of the intern layers.
Definition: neural_net.cc:103
void setLayers(std::vector< ANNLayer * > const &layers)
Set the vector of layers.
Definition: neural_net.cc:122
void Activate(Matrix< double > const &inputs)
Activate the neural network and set the matrix of outputs.
Definition: neural_net.cc:186