PetaVision  Alpha
BinningLayer.hpp
1 #ifndef BINNINGLAYER_HPP_
2 #define BINNINGLAYER_HPP_
3 
4 #include "HyPerLayer.hpp"
5 
6 namespace PV {
7 
22 class BinningLayer : public PV::HyPerLayer {
23 
24  protected:
35  void ioParam_originalLayerName(enum ParamsIOFlag ioFlag);
36 
41  void ioParam_binMin(enum ParamsIOFlag ioFlag);
42 
47  void ioParam_binMax(enum ParamsIOFlag ioFlag);
48 
54  void ioParam_delay(enum ParamsIOFlag ioFlag);
55 
64  void ioParam_binSigma(enum ParamsIOFlag ioFlag);
65 
70  void ioParam_zeroNeg(enum ParamsIOFlag ioFlag);
71 
77  void ioParam_zeroDCR(enum ParamsIOFlag ioFlag);
80  public:
81  BinningLayer(const char *name, HyPerCol *hc);
82  virtual Response::Status
83  communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) override;
84  virtual Response::Status allocateDataStructures() override;
85  virtual bool activityIsSpiking() override { return false; }
86  virtual ~BinningLayer();
87  float getBinSigma() { return mBinSigma; }
88 
89  protected:
90  BinningLayer();
91  int initialize(const char *name, HyPerCol *hc);
92  int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
93  virtual void allocateV() override;
94  virtual void initializeV() override;
95  virtual void initializeActivity() override;
96  virtual Response::Status updateState(double simTime, double dt) override;
97 
98  float calcGaussian(float x, float sigma);
99 
100  private:
101  int initialize_base();
102  int mDelay = 0;
103  float mBinMax = 0.0f;
104  float mBinMin = 1.0f;
105  float mBinSigma = 0.0f;
106  bool mZeroNeg = true;
107  bool mZeroDCR = false;
108 
109  protected:
110  char *mOriginalLayerName = nullptr;
111  HyPerLayer *mOriginalLayer = nullptr;
112 }; // class BinningLayer
113 
114 } /* namespace PV */
115 #endif
void ioParam_zeroDCR(enum ParamsIOFlag ioFlag)
void ioParam_originalLayerName(enum ParamsIOFlag ioFlag)
void ioParam_binSigma(enum ParamsIOFlag ioFlag)
void ioParam_binMax(enum ParamsIOFlag ioFlag)
void ioParam_delay(enum ParamsIOFlag ioFlag)
int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
void ioParam_zeroNeg(enum ParamsIOFlag ioFlag)
void ioParam_binMin(enum ParamsIOFlag ioFlag)