MLPACK  1.0.11
perceptron.hpp
Go to the documentation of this file.
1 
22 #ifndef __MLPACK_METHODS_PERCEPTRON_PERCEPTRON_HPP
23 #define __MLPACK_METHODS_PERCEPTRON_PERCEPTRON_HPP
24 
25 #include <mlpack/core.hpp>
26 
30 
31 namespace mlpack {
32 namespace perceptron {
33 
43 template<typename LearnPolicy = SimpleWeightUpdate,
44  typename WeightInitializationPolicy = ZeroInitialization,
45  typename MatType = arma::mat>
47 {
48  public:
59  Perceptron(const MatType& data, const arma::Row<size_t>& labels, int iterations);
60 
69  void Classify(const MatType& test, arma::Row<size_t>& predictedLabels);
70 
81  Perceptron(const Perceptron<>& other, MatType& data, const arma::rowvec& D, const arma::Row<size_t>& labels);
82 
83 private:
85  size_t iter;
86 
88  arma::Row<size_t> classLabels;
89 
91  arma::mat weightVectors;
92 
94  arma::mat trainData;
95 
101  void Train(const arma::rowvec& D);
102 };
103 
104 } // namespace perceptron
105 } // namespace mlpack
106 
107 #include "perceptron_impl.hpp"
108 
109 #endif