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.
RBMQuantizer.h
Go to the documentation of this file.
1 
37 #ifndef GRT_RBM_QUANTIZER_HEADER
38 #define GRT_RBM_QUANTIZER_HEADER
39 
40 //Include the main GRT header to get access to the FeatureExtraction base class
41 #include "../../CoreModules/FeatureExtraction.h"
42 #include "../../CoreAlgorithms/BernoulliRBM/BernoulliRBM.h"
43 #include "../../DataStructures/TimeSeriesClassificationData.h"
44 #include "../../DataStructures/ClassificationDataStream.h"
45 #include "../../DataStructures/UnlabelledData.h"
46 
47 GRT_BEGIN_NAMESPACE
48 
50 public:
56  RBMQuantizer(const UINT numClusters=10);
57 
63  RBMQuantizer(const RBMQuantizer &rhs);
64 
68  virtual ~RBMQuantizer();
69 
76  RBMQuantizer& operator=(const RBMQuantizer &rhs);
77 
86  virtual bool deepCopyFrom(const FeatureExtraction *featureExtraction);
87 
96  virtual bool computeFeatures(const VectorFloat &inputVector);
97 
104  virtual bool reset();
105 
111  virtual bool clear();
112 
119  virtual bool saveModelToFile( std::string filename ) const;
120 
127  virtual bool loadModelFromFile( std::string filename );
128 
137  virtual bool saveModelToFile( std::fstream &file ) const;
138 
146  virtual bool loadModelFromFile( std::fstream &file );
147 
154  virtual bool train_(ClassificationData &trainingData);
155 
162  virtual bool train_(TimeSeriesClassificationData &trainingData);
163 
170  virtual bool train_(ClassificationDataStream &trainingData);
171 
178  virtual bool train_(UnlabelledData &trainingData);
179 
186  virtual bool train_(MatrixFloat &trainingData);
187 
194  UINT quantize(const Float inputValue);
195 
202  UINT quantize(const VectorFloat &inputVector);
203 
209  bool getQuantizerTrained() const;
210 
216  UINT getNumClusters() const;
217 
223  UINT getQuantizedValue() const;
224 
231 
238 
244  bool setNumClusters(const UINT numClusters);
245 
246  //Tell the compiler we are using the following functions from the MLBase class to stop hidden virtual function warnings
247  using MLBase::train;
248  using MLBase::train_;
249  using MLBase::predict;
250  using MLBase::predict_;
251 
252 protected:
253  UINT numClusters;
254  BernoulliRBM rbm;
255  VectorFloat quantizationDistances;
256 
258 };
259 
260 GRT_END_NAMESPACE
261 
262 #endif //GRT_RBM_QUANTIZER_HEADER
virtual bool predict(VectorFloat inputVector)
Definition: MLBase.cpp:112
virtual bool deepCopyFrom(const FeatureExtraction *featureExtraction)
virtual bool predict_(VectorFloat &inputVector)
Definition: MLBase.cpp:114
UINT getNumClusters() const
virtual bool loadModelFromFile(std::string filename)
virtual bool clear()
UINT quantize(const Float inputValue)
virtual bool train(ClassificationData trainingData)
Definition: MLBase.cpp:88
RBMQuantizer & operator=(const RBMQuantizer &rhs)
BernoulliRBM getBernoulliRBM() const
virtual bool saveModelToFile(std::string filename) const
VectorFloat getQuantizationDistances() const
bool setNumClusters(const UINT numClusters)
virtual bool reset()
virtual bool computeFeatures(const VectorFloat &inputVector)
virtual bool train_(ClassificationData &trainingData)
UINT getQuantizedValue() const
virtual bool train_(ClassificationData &trainingData)
Definition: MLBase.cpp:90
bool getQuantizerTrained() const
virtual ~RBMQuantizer()
RBMQuantizer(const UINT numClusters=10)