GestureRecognitionToolkit  Version: 0.2.0
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
Softmax.h
Go to the documentation of this file.
1 
33 #ifndef GRT_SOFTMAX_HEADER
34 #define GRT_SOFTMAX_HEADER
35 
36 #include "../../CoreModules/Classifier.h"
37 #include "SoftmaxModel.h"
38 
39 GRT_BEGIN_NAMESPACE
40 
41 class GRT_API Softmax : public Classifier
42 {
43  public:
52  Softmax(const bool useScaling=false,const Float learningRate = 0.1,const Float minChange = 1.0e-10,const UINT maxNumEpochs = 1000);
53 
59  Softmax(const Softmax &rhs);
60 
64  virtual ~Softmax(void);
65 
72  Softmax &operator=(const Softmax &rhs);
73 
81  virtual bool deepCopyFrom(const Classifier *classifier);
82 
90  virtual bool train_(ClassificationData &trainingData);
91 
99  virtual bool predict_(VectorFloat &inputVector);
100 
107  virtual bool clear();
108 
116  virtual bool save( std::fstream &file ) const;
117 
125  virtual bool load( std::fstream &file );
126 
132  Vector< SoftmaxModel > getModels() const;
133 
134  //Tell the compiler we are using the base class train method to stop hidden virtual function warnings
135  using MLBase::save;
136  using MLBase::load;
137 
138  protected:
139  bool trainSoftmaxModel(UINT classLabel,SoftmaxModel &model,ClassificationData &data);
140  bool loadLegacyModelFromFile( std::fstream &file );
141 
142  Vector< SoftmaxModel > models;
143 
144  static RegisterClassifierModule< Softmax > registerModule;
145 };
146 
147 GRT_END_NAMESPACE
148 
149 #endif //GRT_SOFTMAX_HEADER
150 
virtual bool predict_(VectorFloat &inputVector)
Definition: MLBase.cpp:115
virtual bool save(const std::string filename) const
Definition: MLBase.cpp:143
virtual bool load(const std::string filename)
Definition: MLBase.cpp:167
virtual bool deepCopyFrom(const Classifier *classifier)
Definition: Classifier.h:63
virtual bool train_(ClassificationData &trainingData)
Definition: MLBase.cpp:91
This file implements a container for a Softmax model.
virtual bool clear()
Definition: Classifier.cpp:142