8 #include "InitSmartWeights.hpp" 12 InitSmartWeights::InitSmartWeights(
char const *name, HyPerCol *hc) : InitWeights() {
13 InitSmartWeights::initialize(name, hc);
16 InitSmartWeights::InitSmartWeights() {}
18 InitSmartWeights::~InitSmartWeights() {}
20 int InitSmartWeights::initialize(
char const *name, HyPerCol *hc) {
21 int status = InitWeights::initialize(name, hc);
27 smartWeights(dataStart, patchIndex);
30 void InitSmartWeights::smartWeights(
float *dataStart,
int k) {
35 int const sxp = mWeights->
getGeometry()->getPatchStrideX();
36 int const syp = mWeights->
getGeometry()->getPatchStrideY();
37 int const sfp = mWeights->
getGeometry()->getPatchStrideF();
40 for (
int y = 0; y < nyp; y++) {
41 for (
int x = 0; x < nxp; x++) {
42 for (
int f = 0; f < nfp; f++) {
43 dataStart[x * sxp + y * syp + f * sfp] = dataIndexToUnitCellIndex(k);
int getPatchSizeX() const
float * getDataFromDataIndex(int arbor, int dataIndex)
int getPatchSizeY() const
std::shared_ptr< PatchGeometry > getGeometry() const
virtual void calcWeights()
int getPatchSizeF() const