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