19 #include "Estimator.hpp" 20 #include "math/Func.hpp" 21 #include "math/Plotter.hpp" 30 std::vector<Layer> layers;
32 std::shared_ptr<std::function<std::vector<double>(
const std::vector<double> &target,
33 const std::vector<double> &out)>> errorFunc;
37 void trainStep(
const std::vector<double> &trainPattern,
const std::vector<double> &expectedResults,
43 typedef std::function<std::vector<double>(
const std::vector<double> &target,
44 const std::vector<double> &out)> error_func;
49 Network(
const std::vector<size_t> &layers,
const math::Func &activationFunc,
const Layer::weights_initializer &init);
50 Network(
const std::vector<size_t> &layers,
const std::vector<math::Func> &activationFuncs,
51 const Layer::weights_initializer &init);
62 void setWeights(
const std::vector<std::vector<double>> &weights);
63 void setWeights(
const std::vector<weightsMatrix> &weights);
64 void setWeights(std::vector<weightsMatrix> &&weights);
65 void setRandomWeights();
71 std::vector<double>
compute(
const std::vector<double> &inputs);
std::vector< double > compute(const std::vector< double > &inputs)
Computes the result for the given inputs.
Definition: Network.cpp:226
This class represent a mathematical function used as activation function.
Definition: Func.hpp:24
void setErrorFunction(const error_func &error)
Sets a new error function to minimize. This error function accepts in input the target value and the ...
Definition: Network.cpp:185
This is the struct that represents the dataset to handle. It has three attributes: ...
Definition: dataStructures.h:27
std::vector< weightsMatrix > getWeights() const
Returns a vector with the matrix of weights of each layer.
Definition: Network.cpp:194
std::vector< std::size_t > getlayersSizes() const
Returns a vector with the size of each layer.
Definition: Network.cpp:208
The parameters object. It holds all the settable hyper-parameters:
Definition: dataStructures.h:78
Definition: Estimator.hpp:28
Definition: constants.h:15
Network & operator=(const Network &rhs)
Copy assignment.
Definition: Network.cpp:120
This is the core class, that represents the whole Neural Network.
Definition: Network.hpp:26
Network()
Creates a new empty network.
Definition: Network.cpp:61
void train(const sann::dataSet &trainingSet, sann::Estimator &est, const sann::parameters &hyperPar)
Trains the network using the training set passed as input.
Definition: Network.cpp:280