1 #ifndef BACKPROPAGATIONALGORITHM_H
2 #define BACKPROPAGATIONALGORITHM_H
4 #include "NeuralNetConfig.h"
23 void setLearningRate(
const double newLearningRate)
24 { _learningRate = newLearningRate;}
25 void setMomentumConstant(
const double newMomentumConstant)
26 { _momentumConstant = newMomentumConstant;}
27 double train(
const std::vector<double> &inputValues,
const std::vector<double> &desiredOutput);
30 std::vector<double> layerOutput(
const int layer)
const;
31 void calculateLayerOutputs();
32 void calculateDerivativeOutputs();
33 void calculateErrorSignals();
34 void calculateDeltaWeights();
38 typedef std::vector<std::vector<double> > NetMatrix;
43 const std::vector<double> *_inputs,*_target;
44 NetMatrix _neuronErrorSignals;
45 NetMatrix _neuronOutputs;
46 NetMatrix _neuronDerivativeOutputs;
47 std::vector<double> _momentumWeights;
48 double _momentumConstant;