PetaVision  Alpha
PoolingConn.hpp
1 /*
2  * PoolingConn.hpp
3  *
4  * Created on: Feburary 27, 2014
5  * Author: slundquist
6  */
7 
8 #ifndef POOLINGCONN_HPP_
9 #define POOLINGCONN_HPP_
10 
11 #include "components/ImpliedWeightsPair.hpp"
12 #include "components/PatchSize.hpp"
13 #include "connections/BaseConnection.hpp"
14 
15 namespace PV {
16 
17 class HyPerCol;
18 
19 class PoolingConn : public BaseConnection {
20  public:
21  PoolingConn(char const *name, HyPerCol *hc);
22 
23  virtual ~PoolingConn();
24 
25  // get-methods for params
26  int getPatchSizeX() const { return mPatchSize->getPatchSizeX(); }
27  int getPatchSizeY() const { return mPatchSize->getPatchSizeY(); }
28  int getPatchSizeF() const { return mPatchSize->getPatchSizeF(); }
29 
30  // other get-methods
31  int getNumDataPatches() const { return mWeightsPair->getPreWeights()->getNumDataPatches(); }
32  int getNumGeometryPatches() const {
33  return mWeightsPair->getPreWeights()->getGeometry()->getNumPatches();
34  }
35  Patch const *getPatch(int kPre) { return &mWeightsPair->getPreWeights()->getPatch(kPre); }
36  int getPatchStrideX() const { return mWeightsPair->getPreWeights()->getPatchStrideX(); }
37  int getPatchStrideY() const { return mWeightsPair->getPreWeights()->getPatchStrideY(); }
38  int getPatchStrideF() const { return mWeightsPair->getPreWeights()->getPatchStrideF(); }
39 
40  protected:
41  PoolingConn();
42 
43  int initialize(char const *name, HyPerCol *hc);
44 
45  virtual void defineComponents() override;
46 
47  virtual BaseDelivery *createDeliveryObject() override;
48 
49  virtual PatchSize *createPatchSize();
50 
51  virtual WeightsPairInterface *createWeightsPair();
52 
53  protected:
54  PatchSize *mPatchSize = nullptr;
55  WeightsPairInterface *mWeightsPair = nullptr;
56 
57 }; // class PoolingConn
58 
59 } // namespace PV
60 
61 #endif // POOLINGCONN_HPP_
int getPatchStrideF() const
Definition: Weights.hpp:236
int getNumDataPatches() const
Definition: Weights.hpp:174
Patch const & getPatch(int patchIndex) const
Definition: Weights.cpp:194
std::shared_ptr< PatchGeometry > getGeometry() const
Definition: Weights.hpp:148
int getPatchStrideY() const
Definition: Weights.hpp:248
int getPatchStrideX() const
Definition: Weights.hpp:242