8 #include "normalizers/NormalizeGroup.hpp" 9 #include "columns/ObjectMapComponent.hpp" 10 #include "components/WeightsPair.hpp" 11 #include "connections/HyPerConn.hpp" 12 #include "utils/MapLookupByType.hpp" 16 NormalizeGroup::NormalizeGroup(
char const *name, HyPerCol *hc) { initialize(name, hc); }
18 NormalizeGroup::NormalizeGroup() {}
20 NormalizeGroup::~NormalizeGroup() { free(mNormalizeGroupName); }
22 int NormalizeGroup::initialize(
char const *name, HyPerCol *hc) {
23 int status = NormalizeBase::initialize(name, hc);
39 parent->parameters()->ioParamStringRequired(
40 ioFlag, name,
"normalizeGroupName", &mNormalizeGroupName);
44 NormalizeGroup::communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) {
45 auto status = NormalizeBase::communicateInitInfo(message);
46 if (status != Response::SUCCESS) {
51 mapLookupByType<ObjectMapComponent>(message->mHierarchy, getDescription());
52 pvAssert(objectMapComponent);
54 objectMapComponent->lookup<
HyPerConn>(std::string(mNormalizeGroupName));
55 mGroupHead = groupHeadConn->getComponentByType<
NormalizeBase>();
57 if (mGroupHead ==
nullptr) {
58 if (parent->getCommunicator()->globalCommRank() == 0) {
60 "%s: normalizeGroupName \"%s\" is not a recognized normalizer.\n",
64 MPI_Barrier(parent->getCommunicator()->globalCommunicator());
68 auto hierarchy = message->mHierarchy;
69 WeightsPair *weightsPair = mapLookupByType<WeightsPair>(hierarchy, getDescription());
70 Weights *preWeights = weightsPair->getPreWeights();
72 mGroupHead->addWeightsToList(preWeights);
73 return Response::SUCCESS;
virtual int normalizeWeights() override
virtual void ioParam_normalizeOnInitialize(enum ParamsIOFlag ioFlag) override
int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
virtual void ioParam_normalizeArborsIndividually(enum ParamsIOFlag ioFlag) override
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
virtual void ioParam_normalizeGroupName(enum ParamsIOFlag ioFlag)
virtual void ioParam_normalizeOnWeightUpdate(enum ParamsIOFlag ioFlag) override