10 #define HYPERCONN_HPP_ 12 #include "components/ArborList.hpp" 13 #include "components/ConnectionData.hpp" 14 #include "components/SharedWeights.hpp" 15 #include "components/WeightsPair.hpp" 16 #include "connections/BaseConnection.hpp" 17 #include "normalizers/NormalizeBase.hpp" 18 #include "weightinit/InitWeights.hpp" 19 #include "weightupdaters/BaseWeightUpdater.hpp" 31 virtual Response::Status respond(std::shared_ptr<BaseMessage const> message)
override;
34 int getPatchSizeX()
const {
return mPatchSize->getPatchSizeX(); }
35 int getPatchSizeY()
const {
return mPatchSize->getPatchSizeY(); }
36 int getPatchSizeF()
const {
return mPatchSize->getPatchSizeF(); }
37 int getSharedWeights()
const {
return mSharedWeights->getSharedWeights(); }
40 int getDelay(
int arbor)
const {
return mArborList->getDelay(arbor); }
42 int getStrength()
const {
return mWeightNormalizer->getStrength(); }
45 int getNumDataPatches()
const {
return mWeightsPair->getPreWeights()->
getNumDataPatches(); }
46 int getNumGeometryPatches()
const {
47 return mWeightsPair->getPreWeights()->
getGeometry()->getNumPatches();
49 Patch const *getPatch(
int kPre) {
return &mWeightsPair->getPreWeights()->
getPatch(kPre); }
50 float *getWeightsDataStart(
int arbor)
const {
51 return mWeightsPair->getPreWeights()->
getData(arbor);
53 float *getWeightsDataHead(
int arbor,
int dataIndex)
const {
56 float *getWeightsData(
int arbor,
int patchIndex) {
57 auto *preWeights = mWeightsPair->getPreWeights();
59 + preWeights->getPatch(patchIndex).offset;
61 float const *getDeltaWeightsDataStart(
int arbor)
const;
62 float const *getDeltaWeightsDataHead(
int arbor,
int dataIndex)
const;
63 int getPatchStrideX()
const {
return mWeightsPair->getPreWeights()->
getPatchStrideX(); }
64 int getPatchStrideY()
const {
return mWeightsPair->getPreWeights()->
getPatchStrideY(); }
65 int getPatchStrideF()
const {
return mWeightsPair->getPreWeights()->
getPatchStrideF(); }
67 double getLastUpdateTime()
const {
return mWeightsPair->getPreWeights()->
getTimestamp(); }
69 int calcDataIndexFromPatchIndex(
int patchIndex) {
70 return mWeightsPair->getPreWeights()->calcDataIndexFromPatchIndex(patchIndex);
76 int initialize(
char const *name,
HyPerCol *hc);
78 virtual void defineComponents()
override;
89 Response::Status respondConnectionUpdate(std::shared_ptr<ConnectionUpdateMessage const> message);
92 respondConnectionNormalize(std::shared_ptr<ConnectionNormalizeMessage const> message);
94 virtual Response::Status registerData(
Checkpointer *checkpointer)
override;
96 virtual Response::Status initializeState()
override;
107 Timer *mUpdateTimer =
nullptr;
113 #endif // HYPERCONN_HPP_ float * getData(int arbor)
int getPatchStrideF() const
int getNumDataPatches() const
Patch const & getPatch(int patchIndex) const
float * getDataFromDataIndex(int arbor, int dataIndex)
std::shared_ptr< PatchGeometry > getGeometry() const
int getPatchStrideY() const
int getNumAxonalArbors() const
float * getDataFromPatchIndex(int arbor, int patchIndex)
double getTimestamp() const
int getPatchStrideX() const