8 #ifndef MOMENTUMUPDATER_HPP_ 9 #define MOMENTUMUPDATER_HPP_ 11 #include "weightupdaters/HebbianUpdater.hpp" 82 static constexpr
float mDefaultTimeConstantTauSimple = 0.25f;
83 static constexpr
float mDefaultTimeConstantTauViscosity = 100.0f;
84 static constexpr
float mDefaultTimeConstantTauAlex = 0.9f;
90 char const *getMomentumMethod() {
return mMomentumMethod; }
91 float getTimeConstantTau()
const {
return mTimeConstantTau; }
92 bool isUsingDeprecatedMomentumTau()
const {
return mUsingDeprecatedMomentumTau; }
97 int initialize(
char const *name,
HyPerCol *hc);
99 virtual void setObjectType()
override;
103 void checkTimeConstantTau();
105 virtual Response::Status allocateDataStructures()
override;
107 virtual Response::Status registerData(
Checkpointer *checkpointer)
override;
109 virtual Response::Status readStateFromCheckpoint(
Checkpointer *checkpointer)
override;
111 virtual int updateWeights(
int arborId)
override;
113 void applyMomentum(
int arborId);
115 void applyMomentum(
int arborId,
float dwFactor,
float wFactor);
117 void applyMomentumDeprecated(
int arborId);
119 void applyMomentumDeprecated(
int arborId,
float dwFactor,
float wFactor);
122 enum Method { UNDEFINED_METHOD, VISCOSITY, SIMPLE, ALEX };
124 char *mMomentumMethod =
nullptr;
125 Method mMethod = UNDEFINED_METHOD;
126 float mMomentumTau = 0.25f;
127 float mTimeConstantTau = mDefaultTimeConstantTauViscosity;
128 float mMomentumDecay = 0.0f;
130 Weights *mPrevDeltaWeights =
nullptr;
131 bool mUsingDeprecatedMomentumTau =
false;
136 #endif // MOMENTUMUPDATER_HPP_
virtual void ioParam_momentumMethod(enum ParamsIOFlag ioFlag)
momentumMethod: Controls the interpretation of the timeConstantTau and momentumDelay parameters...
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
virtual void ioParam_momentumDecay(enum ParamsIOFlag ioFlag)
virtual void ioParam_timeConstantTau(enum ParamsIOFlag ioFlag)
timeConstantTau: controls the amount of momentum in weight updates.
virtual void ioParam_momentumTau(enum ParamsIOFlag ioFlag)
momentumTau: controls the amount of momentum in weight updates. Deprecated in favor of timeConstantTa...