7 #ifndef FEEDFORWARDNEURALNETWORK_H__
8 #define FEEDFORWARDNEURALNETWORK_H__
12 #include "Perceptron.h"
88 double GetLearningRate()
const;
95 double GetMomentum()
const;
102 double GetQpropMu()
const;
109 double GetQpropWeightDecay()
const;
117 double GetRpropWeightStepInitial()
const;
127 double GetRpropWeightStepMin()
const;
138 double GetRpropWeightStepMax()
const;
151 double GetRpropIncreaseFactor()
const;
163 double GetRpropDecreaseFactor()
const;
172 double GetSarpropWeightDecayShift()
const;
180 double GetSarpropStepThresholdFactor()
const;
188 double GetSarpropStepShift()
const;
196 double GetSarpropTemperature()
const;
232 void UpdateWeightsOnline();
233 void UpdateWeightsOffline(
size_t current_epoch,
size_t step_count);
234 void UpdateWeightsBatchingBackpropagation(
size_t step_count);
235 void UpdateWeightsQuickBackpropagation(
size_t step_count);
236 void UpdateWeightsResilientBackpropagation();
237 void UpdateWeightsSimulatedAnnealingResilientBackpropagation(
238 size_t current_epoch);
240 void ResetWeightSteps();
242 void ResetPreviousSlopes();
244 void TrainOffline(
TrainingData* training_data,
size_t epoch_count);
245 void TrainOnline(
TrainingData* training_data,
size_t epoch_count);
248 static constexpr
double DefaultLearningRate = 0.7;
249 static constexpr
double DefaultMomentum = 0.1;
250 static constexpr
double DefaultQpropMu = 1.75;
251 static constexpr
double DefaultQpropWeightDecay = -0.0001;
252 static constexpr
double DefaultRpropWeightStepInitial = 0.0125;
253 static constexpr
double DefaultRpropWeightStepMin = 0.000001;
254 static constexpr
double DefaultRpropWeightStepMax = 50;
255 static constexpr
double DefaultRpropIncreaseFactor = 1.2;
256 static constexpr
double DefaultRpropDecreaseFactor = 0.5;
257 static constexpr
double DefaultSarpropWeightDecayShift = 0.01;
258 static constexpr
double DefaultSarpropStepThresholdFactor = 0.1;
259 static constexpr
double DefaultSarpropStepShift = 3;
260 static constexpr
double DefaultSarpropTemperature = 0.015;
262 std::vector<double> previous_weight_steps_;
263 std::vector<double> slopes_;
264 std::vector<double> previous_slopes_;
266 double learning_rate_ = DefaultLearningRate;
267 double momentum_ = DefaultMomentum;
268 double qprop_mu_ = DefaultQpropMu;
269 double qprop_weight_decay_ = DefaultQpropWeightDecay;
270 double rprop_weight_step_initial_ = DefaultRpropWeightStepInitial;
271 double rprop_weight_step_min_ = DefaultRpropWeightStepMin;
272 double rprop_weight_step_max_ = DefaultRpropWeightStepMax;
273 double rprop_increase_factor_ = DefaultRpropIncreaseFactor;
274 double rprop_decrease_factor_ = DefaultRpropDecreaseFactor;
275 double sarprop_weight_decay_shift_ = DefaultSarpropWeightDecayShift;
276 double sarprop_step_threshold_factor_ = DefaultSarpropStepThresholdFactor;
277 double sarprop_step_shift_ = DefaultSarpropStepShift;
278 double sarprop_temperature_ = DefaultSarpropTemperature;
286 #endif // FEEDFORWARDNEURALNETWORK_H__