| 67 | }; |
| 68 | |
| 69 | class Gaussian : public Initializer { |
| 70 | public: |
| 71 | Gaussian() = default; |
| 72 | Gaussian(const float m, const float s): mean_(m), std_(s) {} |
| 73 | void Setup(const InitializerConf& conf) override { |
| 74 | mean_ = conf.mean(); |
| 75 | std_ = conf.std(); |
| 76 | } |
| 77 | void Fill(Tensor& t) override { singa::Gaussian(mean_, std_, &t); } |
| 78 | |
| 79 | private: |
| 80 | float mean_ = 0, std_ = 1; |
| 81 | }; |
| 82 | |
| 83 | /// Ref: [Bengio and Glorot 2010] Understanding the difficulty of training deep |
| 84 | /// feedforward neural networks |