8 #ifndef NORMALIZEBASE_HPP_ 9 #define NORMALIZEBASE_HPP_ 11 #include "columns/BaseObject.hpp" 12 #include "components/ConnectionData.hpp" 13 #include "components/Weights.hpp" 34 virtual void ioParam_normalizeArborsIndividually(
enum ParamsIOFlag ioFlag);
35 virtual void ioParam_normalizeOnInitialize(
enum ParamsIOFlag ioFlag);
36 virtual void ioParam_normalizeOnWeightUpdate(
enum ParamsIOFlag ioFlag);
44 void addWeightsToList(
Weights *weights);
45 virtual Response::Status respond(std::shared_ptr<BaseMessage const> message)
override;
47 float getStrength()
const {
return mStrength; }
48 bool getNormalizeArborsIndividuallyFlag()
const {
return mNormalizeArborsIndividually; }
49 bool getNormalizeOnInitialize()
const {
return mNormalizeOnInitialize; }
50 bool getNormalizeOnWeightUpdate()
const {
return mNormalizeOnWeightUpdate; }
55 int initialize(
char const *name,
HyPerCol *hc);
57 virtual void setObjectType()
override;
70 virtual Response::Status
71 communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message)
override;
73 bool weightsHaveUpdated()
const;
75 virtual int normalizeWeights() {
return PV_SUCCESS; }
77 static int accumulateSum(
float *dataPatchStart,
int weights_in_patch,
float *sum);
78 static int accumulateSumShrunken(
79 float *dataPatchStart,
86 static int accumulateSumSquared(
float *dataPatchStart,
int weights_in_patch,
float *sumsq);
87 static int accumulateSumSquaredShrunken(
88 float *dataPatchStart,
95 static int accumulateMaxAbs(
float *dataPatchStart,
int weights_in_patch,
float *max);
96 static int accumulateMax(
float *dataPatchStart,
int weights_in_patch,
float *max);
97 static int accumulateMin(
float *dataPatchStart,
int weights_in_patch,
float *max);
100 char *mNormalizeMethod =
nullptr;
101 float mStrength = 1.0f;
102 bool mNormalizeArborsIndividually =
false;
103 bool mNormalizeOnInitialize =
true;
104 bool mNormalizeOnWeightUpdate =
true;
106 std::vector<Weights *> mWeightsList;
107 double mLastTimeNormalized = 0.0;
112 #endif // NORMALIZEBASE_HPP_
int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
Response::Status respondConnectionNormalize(std::shared_ptr< ConnectionNormalizeMessage const > message)
virtual void ioParam_normalizeMethod(enum ParamsIOFlag ioFlag)
normalizeMethod: Specifies the type of weight normalization.