PetaVision  Alpha
InitUniformRandomWeights.hpp
1 /*
2  * InitUniformRandomWeights.hpp
3  *
4  * Created on: Aug 9, 2011
5  * Author: kpeterson
6  */
7 
8 #ifndef INITUNIFORMRANDOMWEIGHTS_HPP_
9 #define INITUNIFORMRANDOMWEIGHTS_HPP_
10 
11 #include "InitRandomWeights.hpp"
12 
13 namespace PV {
14 
16  protected:
17  void ioParam_wMinInit(enum ParamsIOFlag ioFlag);
18  void ioParam_wMaxInit(enum ParamsIOFlag ioFlag);
19  void ioParam_sparseFraction(enum ParamsIOFlag ioFlag);
20  void ioParam_minNNZ(enum ParamsIOFlag ioFlag);
21 
22  public:
23  InitUniformRandomWeights(char const *name, HyPerCol *hc);
24  virtual ~InitUniformRandomWeights();
25 
26  virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
27 
28  protected:
30  int initialize(char const *name, HyPerCol *hc);
31  void randomWeights(float *patchDataStart, int patchIndex) override;
32 
33  // Data members
34  protected:
35  float mWMin = 0;
36  float mWMax = 1;
37  float mSparseFraction = 0; // Percent of zero values in weight patch
38  int mMinNNZ = 0; // Minimum number of nonzero values
39 
40 }; // class InitUniformRandomWeights
41 
42 } /* namespace PV */
43 #endif /* INITUNIFORMRANDOMWEIGHTS_HPP_ */
void randomWeights(float *patchDataStart, int patchIndex) override
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override