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.
LeakyIntegrator.h
Go to the documentation of this file.
1 
29 #ifndef GRT_LEAKY_INTEGRATOR_HEADER
30 #define GRT_LEAKY_INTEGRATOR_HEADER
31 
32 #include "../CoreModules/PreProcessing.h"
33 
34 GRT_BEGIN_NAMESPACE
35 
36 class GRT_API LeakyIntegrator : public PreProcessing{
37 public:
44  LeakyIntegrator(const Float leakRate = 0.99,const UINT numDimensions = 1);
45 
51  LeakyIntegrator(const LeakyIntegrator &rhs);
52 
56  virtual ~LeakyIntegrator();
57 
64  LeakyIntegrator& operator=(const LeakyIntegrator &rhs);
65 
74  virtual bool deepCopyFrom(const PreProcessing *preProcessing);
75 
84  virtual bool process(const VectorFloat &inputVector);
85 
93  virtual bool reset();
94 
102  virtual bool save( std::fstream &file ) const;
103 
111  virtual bool load( std::fstream &file );
112 
120  bool init(const Float leakRate,const UINT numDimensions);
121 
128  Float update(const Float x);
129 
136  VectorFloat update(const VectorFloat &x);
137 
145  bool setLeakRate(const Float leakRate);
146 
152  Float getLeakRate();
153 
154  //Tell the compiler we are using the following functions from the MLBase class to stop hidden virtual function warnings
155  using MLBase::save;
156  using MLBase::load;
157 
158 protected:
159  Float leakRate;
161 
163 
164 };
165 
166 GRT_END_NAMESPACE
167 
168 #endif //GRT_LeakyIntegrator_HEADER
169 
virtual bool deepCopyFrom(const PreProcessing *rhs)
Definition: PreProcessing.h:57
VectorFloat y
A buffer holding the previous input value(s)
virtual bool save(const std::string filename) const
Definition: MLBase.cpp:143
virtual bool reset()
virtual bool load(const std::string filename)
Definition: MLBase.cpp:167
virtual bool process(const VectorFloat &inputVector)
Definition: PreProcessing.h:73
Float leakRate
The current leak rate.