mlpack  2.0.1
zero_init.hpp
Go to the documentation of this file.
1 
14 #ifndef __MLPACK_METHODS_PERCEPTRON_INITIALIZATION_METHODS_ZERO_INIT_HPP
15 #define __MLPACK_METHODS_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& weights,
31  arma::vec& biases,
32  const size_t numFeatures,
33  const size_t numClasses)
34  {
35  weights.zeros(numFeatures, numClasses);
36  biases.zeros(numClasses);
37  }
38 }; // class ZeroInitialization
39 
40 } // namespace perceptron
41 } // namespace mlpack
42 
43 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
This class is used to initialize the matrix weightVectors to zero.
Definition: zero_init.hpp:25
static void Initialize(arma::mat &weights, arma::vec &biases, const size_t numFeatures, const size_t numClasses)
Definition: zero_init.hpp:30