PetaVision  Alpha
InputRegionLayer.hpp
1 /*
2  * InputRegionLayer.hpp
3  *
4  * Created on: Aug 30, 2017
5  * Author: pschultz
6  */
7 
8 #ifndef INPUTREGIONLAYER_HPP_
9 #define INPUTREGIONLAYER_HPP_
10 
11 #include "layers/HyPerLayer.hpp"
12 #include "layers/InputLayer.hpp"
13 
14 namespace PV {
15 
21 class InputRegionLayer : public HyPerLayer {
22  public:
23  InputRegionLayer(const char *name, HyPerCol *hc);
24  virtual ~InputRegionLayer();
25  virtual int requireChannel(int channelNeeded, int *numChannelsResult) override;
26  virtual bool needUpdate(double timestamp, double dt) override;
27  virtual bool activityIsSpiking() override { return false; }
28  InputLayer *getOriginalLayer() { return originalLayer; }
29 
30  protected:
32  int initialize(const char *name, HyPerCol *hc);
33  virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
34  virtual void ioParam_originalLayerName(enum ParamsIOFlag ioFlag);
35  virtual void ioParam_phase(enum ParamsIOFlag ioFlag) override;
36  virtual void ioParam_mirrorBCflag(enum ParamsIOFlag ioFlag) override;
37  virtual void ioParam_valueBC(enum ParamsIOFlag ioFlag) override;
38  virtual void ioParam_InitVType(enum ParamsIOFlag ioFlag) override;
39  virtual void ioParam_triggerLayerName(enum ParamsIOFlag ioFlag) override;
40  virtual void ioParam_sparseLayer(enum ParamsIOFlag ioFlag) override;
41  virtual void ioParam_updateGpu(enum ParamsIOFlag ioFlag) override;
42  virtual Response::Status
43  communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) override;
44  void setOriginalLayer(HyPerLayer *layer);
45  void checkLayerDimensions();
46  virtual Response::Status allocateDataStructures() override;
47  virtual void allocateGSyn() override;
48  virtual void allocateV() override;
49  virtual void allocateActivity() override;
50  virtual int setActivity() override;
51 
52  private:
53  int initialize_base();
54 
55  protected:
56  char *originalLayerName;
57  InputLayer *originalLayer;
58 }; // class InputRegionLayer
59 
60 } /* namespace PV */
61 #endif /* INPUTREGIONLAYER_HPP_ */
virtual void ioParam_sparseLayer(enum ParamsIOFlag ioFlag) override
sparseLayer: Specifies if the layer should be considered sparese for optimization and output ...
virtual void ioParam_updateGpu(enum ParamsIOFlag ioFlag) override
updateGpu: When compiled using CUDA or OpenCL GPU acceleration, this flag tells whether this layer&#39;s ...
virtual void ioParam_InitVType(enum ParamsIOFlag ioFlag) override
initVType: Specifies how to initialize the V buffer.
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
virtual bool needUpdate(double timestamp, double dt) override
virtual void ioParam_mirrorBCflag(enum ParamsIOFlag ioFlag) override
mirrorBCflag: If set to true, the margin will mirror the data
virtual void ioParam_phase(enum ParamsIOFlag ioFlag) override
phase: Defines the ordering in which each layer is updated
virtual void ioParam_triggerLayerName(enum ParamsIOFlag ioFlag) override
triggerLayerName: Specifies the name of the layer that this layer triggers off of. If set to NULL or the empty string, the layer does not trigger but updates its state on every timestep.
virtual void ioParam_valueBC(enum ParamsIOFlag ioFlag) override
valueBC: If mirrorBC is set to true, Uses the specified value for the margin area ...