GestureRecognitionToolkit  Version: 1.0 Revision: 04-03-15
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
GRT::MovementDetector Class Reference
Inheritance diagram for GRT::MovementDetector:
GRT::MLBase GRT::GRTBase GRT::Observer< TrainingResult > GRT::Observer< TestInstanceResult >

Public Types

enum  SearchStates { SEARCHING_FOR_MOVEMENT =0, SEARCHING_FOR_NO_MOVEMENT, SEARCH_TIMEOUT }
 
- Public Types inherited from GRT::MLBase
enum  BaseTypes { BASE_TYPE_NOT_SET =0, CLASSIFIER, REGRESSIFIER, CLUSTERER }
 

Public Member Functions

 MovementDetector (const UINT numDimensions=1, const double upperThreshold=1, const double lowerThreshold=0.9, const double gamma=0.95, const UINT searchTimeout=0)
 
virtual bool predict_ (VectorDouble &input)
 
virtual bool clear ()
 
virtual bool reset ()
 
virtual bool saveModelToFile (fstream &file) const
 
virtual bool loadModelFromFile (fstream &file)
 
double getUpperThreshold () const
 
double getLowerThreshold () const
 
double getMovementIndex () const
 
double getGamma () const
 
bool getMovementDetected () const
 
bool getNoMovementDetect () const
 
UINT getState () const
 
UINT getSearchTimeout () const
 
bool setUpperThreshold (const double upperThreshold)
 
bool setLowerThreshold (const double lowerThreshold)
 
bool setGamma (const double gamma)
 
bool setSearchTimeout (const UINT searchTimeout)
 
- Public Member Functions inherited from GRT::MLBase
 MLBase (void)
 
virtual ~MLBase (void)
 
bool copyMLBaseVariables (const MLBase *mlBase)
 
virtual bool train (ClassificationData trainingData)
 
virtual bool train_ (ClassificationData &trainingData)
 
virtual bool train (RegressionData trainingData)
 
virtual bool train_ (RegressionData &trainingData)
 
virtual bool train (TimeSeriesClassificationData trainingData)
 
virtual bool train_ (TimeSeriesClassificationData &trainingData)
 
virtual bool train (TimeSeriesClassificationDataStream trainingData)
 
virtual bool train_ (TimeSeriesClassificationDataStream &trainingData)
 
virtual bool train (UnlabelledData trainingData)
 
virtual bool train_ (UnlabelledData &trainingData)
 
virtual bool train (MatrixDouble data)
 
virtual bool train_ (MatrixDouble &data)
 
virtual bool predict (VectorDouble inputVector)
 
virtual bool predict (MatrixDouble inputMatrix)
 
virtual bool predict_ (MatrixDouble &inputMatrix)
 
virtual bool map (VectorDouble inputVector)
 
virtual bool map_ (VectorDouble &inputVector)
 
virtual bool print () const
 
virtual bool save (const string filename) const
 
virtual bool load (const string filename)
 
virtual bool saveModelToFile (string filename) const
 
virtual bool loadModelFromFile (string filename)
 
virtual bool getModel (ostream &stream) const
 
double scale (const double &x, const double &minSource, const double &maxSource, const double &minTarget, const double &maxTarget, const bool constrain=false)
 
virtual string getModelAsString () const
 
UINT getBaseType () const
 
UINT getNumInputFeatures () const
 
UINT getNumInputDimensions () const
 
UINT getNumOutputDimensions () const
 
UINT getMinNumEpochs () const
 
UINT getMaxNumEpochs () const
 
UINT getValidationSetSize () const
 
UINT getNumTrainingIterationsToConverge () const
 
double getMinChange () const
 
double getLearningRate () const
 
double getRootMeanSquaredTrainingError () const
 
double getTotalSquaredTrainingError () const
 
bool getUseValidationSet () const
 
bool getRandomiseTrainingOrder () const
 
bool getTrained () const
 
bool getModelTrained () const
 
bool getScalingEnabled () const
 
bool getIsBaseTypeClassifier () const
 
bool getIsBaseTypeRegressifier () const
 
bool getIsBaseTypeClusterer () const
 
bool enableScaling (bool useScaling)
 
bool setMaxNumEpochs (const UINT maxNumEpochs)
 
bool setMinNumEpochs (const UINT minNumEpochs)
 
bool setMinChange (const double minChange)
 
bool setLearningRate (double learningRate)
 
bool setUseValidationSet (const bool useValidationSet)
 
bool setValidationSetSize (const UINT validationSetSize)
 
bool setRandomiseTrainingOrder (const bool randomiseTrainingOrder)
 
bool registerTrainingResultsObserver (Observer< TrainingResult > &observer)
 
bool registerTestResultsObserver (Observer< TestInstanceResult > &observer)
 
bool removeTrainingResultsObserver (const Observer< TrainingResult > &observer)
 
bool removeTestResultsObserver (const Observer< TestInstanceResult > &observer)
 
bool removeAllTrainingObservers ()
 
bool removeAllTestObservers ()
 
bool notifyTrainingResultsObservers (const TrainingResult &data)
 
bool notifyTestResultsObservers (const TestInstanceResult &data)
 
MLBasegetMLBasePointer ()
 
const MLBasegetMLBasePointer () const
 
vector< TrainingResultgetTrainingResults () const
 
- Public Member Functions inherited from GRT::GRTBase
 GRTBase (void)
 
virtual ~GRTBase (void)
 
bool copyGRTBaseVariables (const GRTBase *GRTBase)
 
string getClassType () const
 
string getLastWarningMessage () const
 
string getLastErrorMessage () const
 
string getLastInfoMessage () const
 
GRTBasegetGRTBasePointer ()
 
const GRTBasegetGRTBasePointer () const
 
- Public Member Functions inherited from GRT::Observer< TrainingResult >
virtual void notify (const TrainingResult &data)
 
- Public Member Functions inherited from GRT::Observer< TestInstanceResult >
virtual void notify (const TestInstanceResult &data)
 

Protected Attributes

UINT state
 
UINT searchTimeout
 
double upperThreshold
 
double lowerThreshold
 
double movementIndex
 
double gamma
 
bool firstSample
 
bool movementDetected
 
bool noMovementDetected
 
Timer searchTimer
 
VectorDouble lastSample
 
- Protected Attributes inherited from GRT::MLBase
bool trained
 
bool useScaling
 
UINT baseType
 
UINT numInputDimensions
 
UINT numOutputDimensions
 
UINT numTrainingIterationsToConverge
 
UINT minNumEpochs
 
UINT maxNumEpochs
 
UINT validationSetSize
 
double learningRate
 
double minChange
 
double rootMeanSquaredTrainingError
 
double totalSquaredTrainingError
 
bool useValidationSet
 
bool randomiseTrainingOrder
 
Random random
 
vector< TrainingResulttrainingResults
 
TrainingResultsObserverManager trainingResultsObserverManager
 
TestResultsObserverManager testResultsObserverManager
 
- Protected Attributes inherited from GRT::GRTBase
string classType
 
DebugLog debugLog
 
ErrorLog errorLog
 
InfoLog infoLog
 
TrainingLog trainingLog
 
TestingLog testingLog
 
WarningLog warningLog
 

Additional Inherited Members

- Static Public Member Functions inherited from GRT::GRTBase
static string getGRTVersion (bool returnRevision=true)
 
static string getGRTRevison ()
 
- Protected Member Functions inherited from GRT::MLBase
bool saveBaseSettingsToFile (fstream &file) const
 
bool loadBaseSettingsFromFile (fstream &file)
 
- Protected Member Functions inherited from GRT::GRTBase
double SQR (const double &x) const
 

Detailed Description

Definition at line 38 of file MovementDetector.h.

Member Function Documentation

bool MovementDetector::clear ( )
virtual

This overrides the clear function in the ML base class. It will completely clear the ML module, removing any trained model and setting all the base variables to their default values.

Returns
returns true if the module was cleared succesfully, false otherwise

Reimplemented from GRT::MLBase.

Definition at line 84 of file MovementDetector.cpp.

bool MovementDetector::loadModelFromFile ( fstream &  file)
virtual

This loads a trained MovementDetector model from a file. This overrides the loadModelFromFile function in the ML base class.

Parameters
fstream&file: a reference to the file the MovementDetector model will be loaded from
Returns
returns true if the model was loaded successfully, false otherwise

Reimplemented from GRT::MLBase.

Definition at line 126 of file MovementDetector.cpp.

bool MovementDetector::predict_ ( VectorDouble &  inputVector)
virtual

This is the main prediction interface for all the GRT machine learning algorithms. This should be overwritten by the derived class.

Parameters
VectorDouble&inputVector: a reference to the input vector for prediction
Returns
returns true if the prediction was completed succesfully, false otherwise (the base class always returns false)

Reimplemented from GRT::MLBase.

Definition at line 29 of file MovementDetector.cpp.

bool MovementDetector::reset ( )
virtual

This overrides the reset function in the ML base class. It will reset the MovementDetector, setting the state back to the search timeout and resetting the movementIndex to zero.

Returns
returns true if the module was reset succesfully, false otherwise

Reimplemented from GRT::MLBase.

Definition at line 94 of file MovementDetector.cpp.

bool MovementDetector::saveModelToFile ( fstream &  file) const
virtual

This saves the trained MovementDetector model to a file. This overrides the saveModelToFile function in the ML base class.

Parameters
fstream&file: a reference to the file the MovementDetector model will be saved to
Returns
returns true if the model was saved successfully, false otherwise

Reimplemented from GRT::MLBase.

Definition at line 106 of file MovementDetector.cpp.


The documentation for this class was generated from the following files: