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.
TimeseriesBuffer.h
Go to the documentation of this file.
1 
29 #ifndef GRT_TIMESERIES_BUFFER_HEADER
30 #define GRT_TIMESERIES_BUFFER_HEADER
31 
32 #include "../../CoreModules/FeatureExtraction.h"
33 
34 GRT_BEGIN_NAMESPACE
35 
37 public:
44  TimeseriesBuffer(UINT bufferSize = 5,UINT numDimensions = 1);
45 
52 
56  virtual ~TimeseriesBuffer();
57 
65 
74  virtual bool deepCopyFrom(const FeatureExtraction *featureExtraction);
75 
84  virtual bool computeFeatures(const VectorFloat &inputVector);
85 
93  virtual bool reset();
94 
101  virtual bool saveModelToFile( std::string filename ) const;
102 
109  virtual bool loadModelFromFile( std::string filename );
110 
118  virtual bool saveModelToFile( std::fstream &file ) const;
119 
127  virtual bool loadModelFromFile( std::fstream &file );
128 
138  bool init(UINT bufferSize,UINT numDimensions);
139 
146  VectorFloat update(Float x);
147 
154  VectorFloat update(const VectorFloat &x);
155 
163  bool setBufferSize(UINT bufferSize);
164 
170  UINT getBufferSize();
171 
179 
180  //Tell the compiler we are using the following functions from the MLBase class to stop hidden virtual function warnings
181  using MLBase::train;
182  using MLBase::train_;
183  using MLBase::predict;
184  using MLBase::predict_;
185 
186 protected:
187  UINT bufferSize;
189 
191 };
192 
193 GRT_END_NAMESPACE
194 
195 #endif //GRT_TIMESERIES_BUFFER_HEADER
virtual bool loadModelFromFile(std::string filename)
virtual bool saveModelToFile(std::string filename) const
TimeseriesBuffer & operator=(const TimeseriesBuffer &rhs)
virtual bool reset()
virtual bool predict(VectorFloat inputVector)
Definition: MLBase.cpp:112
virtual bool predict_(VectorFloat &inputVector)
Definition: MLBase.cpp:114
bool setBufferSize(UINT bufferSize)
VectorFloat update(Float x)
virtual bool train(ClassificationData trainingData)
Definition: MLBase.cpp:88
TimeseriesBuffer(UINT bufferSize=5, UINT numDimensions=1)
virtual ~TimeseriesBuffer()
virtual bool train_(ClassificationData &trainingData)
Definition: MLBase.cpp:90
virtual bool deepCopyFrom(const FeatureExtraction *featureExtraction)
virtual bool computeFeatures(const VectorFloat &inputVector)
CircularBuffer< VectorFloat > dataBuffer
A buffer used to store the timeseries data.
Vector< VectorFloat > getDataBuffer()