backpropagation implementation

This commit is contained in:
2016-02-07 21:58:21 +01:00
parent 5bd520cfed
commit 5f43fb8cfb
3 changed files with 131 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
#pragma once
#include <vector>
#include <cmath>
#include <NeuralNetwork/FeedForward/Network.h>
namespace NeuralNetwork {
namespace Learning {
/** @class BackPropagation
* @brief
*/
class BackPropagation {
public:
BackPropagation(): learningCoefficient(0.4) {
}
virtual ~BackPropagation() {
}
void teach(FeedForward::Network &n,const std::vector<float> &input, const std::vector<float> &output);
inline virtual void setLearningCoefficient (const float& coefficient) { learningCoefficient=coefficient; }
protected:
inline virtual float correction(const float & expected, const float &computed) {
return expected-computed;
};
float learningCoefficient;
};
}
}