mlpack  1.0.12
zero_init.hpp
Go to the documentation of this file.
1 
14 #ifndef _MLPACK_METHOS_PERCEPTRON_INITIALIZATION_METHODS_ZERO_INIT_HPP
15 #define _MLPACK_METHOS_PERCEPTRON_INITIALIZATION_METHODS_ZERO_INIT_HPP
16 
17 #include <mlpack/core.hpp>
18 
19 namespace mlpack {
20 namespace perceptron {
21 
26 {
27  public:
29 
30  inline static void Initialize(arma::mat& W,
31  const size_t row,
32  const size_t col)
33  {
34  arma::mat tempWeights(row, col);
35  tempWeights.fill(0.0);
36 
37  W = tempWeights;
38  }
39 }; // class ZeroInitialization
40 
41 }; // namespace perceptron
42 }; // namespace mlpack
43 
44 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:23
This class is used to initialize the matrix weightVectors to zero.
Definition: zero_init.hpp:25
static void Initialize(arma::mat &W, const size_t row, const size_t col)
Definition: zero_init.hpp:30