mlpack  2.0.1
random_init.hpp
Go to the documentation of this file.
1 
14 #ifndef __MLPACK_METHODS_PERCEPTRON_INITIALIZATION_METHODS_RANDOM_INIT_HPP
15 #define __MLPACK_METHODS_PERCEPTRON_INITIALIZATION_METHODS_RANDOM_INIT_HPP
16 
17 #include <mlpack/core.hpp>
18 
19 namespace mlpack {
20 namespace perceptron {
21 
27 {
28  public:
30 
31  inline static void Initialize(arma::mat& weights,
32  arma::vec& biases,
33  const size_t numFeatures,
34  const size_t numClasses)
35  {
36  weights.randu(numFeatures, numClasses);
37  biases.randu(numClasses);
38  }
39 }; // class RandomInitialization
40 
41 } // namespace perceptron
42 } // namespace mlpack
43 
44 #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: random_init.hpp:31
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
This class is used to initialize weights for the weightVectors matrix in a random manner...
Definition: random_init.hpp:26