1 #ifndef CNEURALNETWORK_H
2 #define CNEURALNETWORK_H
5 #include <boost/shared_ptr.hpp>
20 typedef std::vector<boost::shared_ptr<GeneralNeuron> >
tNeuralLayer;
22 typedef std::vector<SigmoidalNeuron::tneurontype>
ttypeVector;
26 std::vector<double> &CalcOutput();
28 gplib::rvec WeightsAsVector;
36 std::vector<double> LocInput;
38 std::vector<double> LocOutput;
40 std::vector<double> LocDesired;
57 void InitWeights(
const double MaxWeight,
const double MaxBias);
66 const gplib::rvec &Desired);
68 virtual void CalcOutput(
const gplib::rvec &Input, gplib::rvec &Output);
73 const double mu_,
const ttypeArray &Layerssetup,
74 const double maxinit,
bool cachedoutput =
false);
79 #endif // CNEURALNETWORK_H
void InitWeights(const double MaxWeight, const double MaxBias)
Initialize the weights with random values with the specified maxima.
std::vector< boost::shared_ptr< GeneralNeuron > > tNeuralLayer
void SetLayers(ttypeArray typeArray, bool cachedoutput=false)
Configure the layers of the network according to the types in typeArray.
virtual void PrintWeights(std::ostream &output)
Print the weights of the network to the specified output stream.
void SetAlpha(const double a)
Set the momentum multiplier.
std::vector< ttypeVector > ttypeArray
virtual void AdaptFilter(const gplib::rvec &Input, const gplib::rvec &Desired)
Adapt the Filter with the current input and desired.
void SetMu(const double m)
Set the adaptation stepsize.
A generic base class for all types of adaptive filters.
std::vector< tNeuralLayer > tNeuralArray
std::vector< SigmoidalNeuron::tneurontype > ttypeVector
NeuralNetwork(const int inputsize, const int outputsize)
The minium values for the network are the length of the input and output.
virtual const gplib::rvec & GetWeightsAsVector()
Return the network weights as a single vector.
void PrintTopology(std::string filename)
Print the topology and weights of the network for plotting with the dot program.