zero_init.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_PERCEPTRON_INITIALIZATION_METHODS_ZERO_INIT_HPP
13 #define MLPACK_METHODS_PERCEPTRON_INITIALIZATION_METHODS_ZERO_INIT_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace perceptron {
19 
24 {
25  public:
27 
28  inline static void Initialize(arma::mat& weights,
29  arma::vec& biases,
30  const size_t numFeatures,
31  const size_t numClasses)
32  {
33  weights.zeros(numFeatures, numClasses);
34  biases.zeros(numClasses);
35  }
36 }; // class ZeroInitialization
37 
38 } // namespace perceptron
39 } // namespace mlpack
40 
41 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
static void Initialize(arma::mat &weights, arma::vec &biases, const size_t numFeatures, const size_t numClasses)
Definition: zero_init.hpp:28
The core includes that mlpack expects; standard C++ includes and Armadillo.
This class is used to initialize the matrix weightVectors to zero.
Definition: zero_init.hpp:23