GestureRecognitionToolkit  Version: 1.0 Revision: 04-03-15
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 namespace GRT{
40 
41 class Softmax : public Classifier
42 {
43 public:
52  Softmax(const bool useScaling=false,const double learningRate = 0.1,const double 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_(VectorDouble &inputVector);
100 
107  virtual bool clear();
108 
116  virtual bool saveModelToFile(fstream &file) const;
117 
125  virtual bool loadModelFromFile(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
137 
138 protected:
139  bool trainSoftmaxModel(UINT classLabel,SoftmaxModel &model,ClassificationData &data);
140  bool loadLegacyModelFromFile( fstream &file );
141 
142  vector< SoftmaxModel > models;
143 
144  static RegisterClassifierModule< Softmax > registerModule;
145 };
146 
147 } //End of namespace GRT
148 
149 #endif //GRT_SOFTMAX_HEADER
150 
Softmax(const bool useScaling=false, const double learningRate=0.1, const double minChange=1.0e-10, const UINT maxNumEpochs=1000)
Definition: Softmax.cpp:28
virtual bool saveModelToFile(string filename) const
Definition: MLBase.cpp:135
virtual bool deepCopyFrom(const Classifier *classifier)
Definition: Softmax.cpp:71
virtual bool saveModelToFile(fstream &file) const
Definition: Softmax.cpp:273
virtual bool loadModelFromFile(string filename)
Definition: MLBase.cpp:157
Definition: AdaBoost.cpp:25
virtual bool train_(ClassificationData &trainingData)
Definition: Softmax.cpp:89
virtual ~Softmax(void)
Definition: Softmax.cpp:54
Softmax & operator=(const Softmax &rhs)
Definition: Softmax.cpp:58
virtual bool clear()
Definition: Softmax.cpp:262
virtual bool loadModelFromFile(fstream &file)
Definition: Softmax.cpp:305
vector< SoftmaxModel > getModels() const
Definition: Softmax.cpp:388
bool loadLegacyModelFromFile(fstream &file)
Definition: Softmax.cpp:392
virtual bool predict_(VectorDouble &inputVector)
Definition: Softmax.cpp:133
This file implements a container for a Softmax model.