PetaVision  Alpha
SigmoidLayer.hpp
1 /*
2  * SigmoidLayer.hpp
3  * can be used to implement Sigmoid junctions
4  *
5  * Created on: May 11, 2011
6  * Author: garkenyon
7  */
8 
9 #ifndef SIGMOIDLAYER_HPP_
10 #define SIGMOIDLAYER_HPP_
11 
12 #include "CloneVLayer.hpp"
13 
14 namespace PV {
15 
16 // SigmoidLayer can be used to implement Sigmoid junctions between spiking neurons
17 class SigmoidLayer : public CloneVLayer {
18  public:
19  SigmoidLayer(const char *name, HyPerCol *hc);
20  virtual ~SigmoidLayer();
21  virtual Response::Status
22  communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) override;
23  virtual Response::Status allocateDataStructures() override;
24  virtual Response::Status updateState(double timef, double dt) override;
25  virtual int setActivity() override;
26 
27  protected:
28  SigmoidLayer();
29  int initialize(const char *name, HyPerCol *hc);
30  virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
31  virtual void ioParam_Vrest(enum ParamsIOFlag ioFlag);
32  virtual void ioParam_VthRest(enum ParamsIOFlag ioFlag);
33  virtual void ioParam_InverseFlag(enum ParamsIOFlag ioFlag);
34  virtual void ioParam_SigmoidFlag(enum ParamsIOFlag ioFlag);
35  virtual void ioParam_SigmoidAlpha(enum ParamsIOFlag ioFlag);
36  /* static */ void updateState(
37  double timef,
38  double dt,
39  const PVLayerLoc *loc,
40  float *A,
41  float *V,
42  int num_channels,
43  float *gSynHead,
44  float Vth,
45  float V0,
46  float sigmoid_alpha,
47  bool sigmoid_flag,
48  bool inverse_flag);
49 
50  private:
51  int initialize_base();
52  float V0;
53  float Vth;
54  bool InverseFlag;
55  bool SigmoidFlag;
56  float SigmoidAlpha;
57 }; // class SigmoidLayer
58 
59 } // namespace PV
60 
61 #endif /* CLONELAYER_HPP_ */
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override