quickProp implementation after refactoring

This commit is contained in:
2016-11-01 21:40:00 +01:00
parent 173cfc9789
commit 8b2a4e89b3
3 changed files with 52 additions and 68 deletions

View File

@@ -4,7 +4,7 @@
#include <cmath>
#include <NeuralNetwork/FeedForward/Network.h>
#include "BackPropagation.h"
#include "BatchPropagation.h"
namespace NeuralNetwork {
namespace Learning {
@@ -12,27 +12,33 @@ namespace NeuralNetwork {
/** @class QuickPropagation
* @brief
*/
class QuickPropagation : public BackPropagation {
class QuickPropagation : public BatchPropagation {
public:
inline QuickPropagation(FeedForward::Network &feedForwardNetwork, std::shared_ptr<CorrectionFunction::CorrectionFunction> correction = std::make_shared<CorrectionFunction::Linear>()):
BackPropagation(feedForwardNetwork,correction) {
BatchPropagation(feedForwardNetwork,correction) {
}
virtual ~QuickPropagation() {
}
protected:
float _maxChange=1.75;
float _epsilon=0.5;
virtual inline void resize() override {
BackPropagation::resize();
_previousSlopes = _slopes;
void setLearningCoefficient (const float& coefficient) {
}
std::vector<std::vector<float>> _previousSlopes ={};
protected:
virtual void updateWeightsAndEndBatch() override;
float _maxChange=1.75;
virtual inline void resize() override {
BatchPropagation::resize();
_lastGradients = _gradients;
_lastDeltas = _gradients;
}
std::vector<std::vector<std::vector<float>>> _lastDeltas = {};
std::vector<std::vector<std::vector<float>>> _lastGradients = {};
};
}
}