PetaVision  Alpha
InitGaussianRandomWeights.hpp
1 /*
2  * InitGaussianRandomWeights.hpp
3  *
4  * Created on: Aug 9, 2011
5  * Author: kpeterson
6  */
7 
8 #ifndef INITGAUSSIANRANDOMWEIGHTS_HPP_
9 #define INITGAUSSIANRANDOMWEIGHTS_HPP_
10 
11 #include "InitRandomWeights.hpp"
12 #include "columns/GaussianRandom.hpp"
13 
14 namespace PV {
15 
17  protected:
18  void ioParam_wGaussMean(enum ParamsIOFlag ioFlag);
19  void ioParam_wGaussStdev(enum ParamsIOFlag ioFlag);
20 
21  public:
22  InitGaussianRandomWeights(char const *name, HyPerCol *hc);
23  virtual ~InitGaussianRandomWeights();
24 
25  int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
26 
27  protected:
29  int initialize(char const *name, HyPerCol *hc);
30  virtual int initRNGs(bool isKernel) override;
31  virtual void randomWeights(float *patchDataStart, int patchIndex) override;
32 
33  // Member variables
34  protected:
35  GaussianRandom *mGaussianRandState;
36  // Use this instead of randState to use Box-Muller transformation.
37 
38  float mWGaussMean;
39  float mWGaussStdev;
40 }; // class InitGaussianRandomWeights
41 
42 } /* namespace PV */
43 
44 #endif // INITGAUSSIANRANDOMWEIGHTS_HPP_
virtual void randomWeights(float *patchDataStart, int patchIndex) override
int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override