GestureRecognitionToolkit  Version: 0.1.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 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 saveModelToFile( std::fstream &file ) const;
117 
125  virtual bool loadModelFromFile( std::fstream &file );
126 
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( 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 ~Softmax(void)
Definition: Softmax.cpp:54
bool loadLegacyModelFromFile(std::fstream &file)
Definition: Softmax.cpp:392
virtual bool clear()
Definition: Softmax.cpp:262
Vector< SoftmaxModel > getModels() const
Definition: Softmax.cpp:388
virtual bool predict_(VectorFloat &inputVector)
Definition: Softmax.cpp:133
Softmax(const bool useScaling=false, const Float learningRate=0.1, const Float minChange=1.0e-10, const UINT maxNumEpochs=1000)
Definition: Softmax.cpp:28
Softmax & operator=(const Softmax &rhs)
Definition: Softmax.cpp:58
virtual bool saveModelToFile(std::string filename) const
Definition: MLBase.cpp:146
virtual bool loadModelFromFile(std::string filename)
Definition: MLBase.cpp:168
virtual bool deepCopyFrom(const Classifier *classifier)
Definition: Softmax.cpp:71
This file implements a container for a Softmax model.
virtual bool train_(ClassificationData &trainingData)
Definition: Softmax.cpp:89
virtual bool loadModelFromFile(std::fstream &file)
Definition: Softmax.cpp:305
virtual bool saveModelToFile(std::fstream &file) const
Definition: Softmax.cpp:273