GestureRecognitionToolkit  Version: 0.2.5
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 
27 #ifndef GRT_LEAKY_INTEGRATOR_HEADER
28 #define GRT_LEAKY_INTEGRATOR_HEADER
29 
30 #include "../CoreModules/PreProcessing.h"
31 
32 GRT_BEGIN_NAMESPACE
33 
37 class GRT_API LeakyIntegrator : public PreProcessing{
38 public:
45  LeakyIntegrator(const Float leakRate = 0.99,const UINT numDimensions = 1);
46 
52  LeakyIntegrator(const LeakyIntegrator &rhs);
53 
57  virtual ~LeakyIntegrator();
58 
65  LeakyIntegrator& operator=(const LeakyIntegrator &rhs);
66 
75  virtual bool deepCopyFrom(const PreProcessing *preProcessing);
76 
85  virtual bool process(const VectorFloat &inputVector);
86 
94  virtual bool reset();
95 
103  virtual bool save( std::fstream &file ) const;
104 
112  virtual bool load( std::fstream &file );
113 
121  bool init(const Float leakRate,const UINT numDimensions);
122 
129  Float update(const Float x);
130 
137  VectorFloat update(const VectorFloat &x);
138 
146  bool setLeakRate(const Float leakRate);
147 
153  Float getLeakRate() const;
154 
160  static std::string getId();
161 
162  //Tell the compiler we are using the following functions from the MLBase class to stop hidden virtual function warnings
163  using MLBase::save;
164  using MLBase::load;
165 
166 protected:
167  Float leakRate;
169 
170 private:
171  static const std::string id;
173 
174 };
175 
176 GRT_END_NAMESPACE
177 
178 #endif //GRT_LeakyIntegrator_HEADER
179 
std::string getId() const
Definition: GRTBase.cpp:85
virtual bool deepCopyFrom(const PreProcessing *rhs)
Definition: PreProcessing.h:58
virtual bool save(const std::string &filename) const
Definition: MLBase.cpp:167
virtual bool reset() override
VectorFloat y
A buffer holding the previous input value(s)
virtual bool process(const VectorFloat &inputVector)
Definition: PreProcessing.h:74
virtual bool load(const std::string &filename)
Definition: MLBase.cpp:190
The LeakyIntegrator class computes the following signal: y = y*z + x, where x is the input...
Float leakRate
The current leak rate.