quickProp implementation after refactoring
This commit is contained in:
@@ -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 = {};
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user