![]() |
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.
|
Public Types | |
typedef std::map< string, FeatureExtraction *(*)() > | StringFeatureExtractionMap |
![]() | |
enum | BaseTypes { BASE_TYPE_NOT_SET =0, CLASSIFIER, REGRESSIFIER, CLUSTERER } |
Public Member Functions | |
FeatureExtraction () | |
virtual | ~FeatureExtraction () |
virtual bool | deepCopyFrom (const FeatureExtraction *rhs) |
bool | copyBaseVariables (const FeatureExtraction *featureExtractionModule) |
virtual bool | computeFeatures (const VectorDouble &inputVector) |
virtual bool | reset () |
virtual bool | clear () |
virtual bool | saveModelToFile (fstream &file) const |
virtual bool | loadModelFromFile (fstream &file) |
string | getFeatureExtractionType () const |
UINT | getNumInputDimensions () const |
UINT | getNumOutputDimensions () const |
bool | getInitialized () const |
bool | getFeatureDataReady () const |
VectorDouble | getFeatureVector () const |
FeatureExtraction * | createNewInstance () const |
![]() | |
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_ (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) |
MLBase * | getMLBasePointer () |
const MLBase * | getMLBasePointer () const |
vector< TrainingResult > | getTrainingResults () const |
![]() | |
GRTBase (void) | |
virtual | ~GRTBase (void) |
bool | copyGRTBaseVariables (const GRTBase *GRTBase) |
string | getClassType () const |
string | getLastWarningMessage () const |
string | getLastErrorMessage () const |
string | getLastInfoMessage () const |
GRTBase * | getGRTBasePointer () |
const GRTBase * | getGRTBasePointer () const |
![]() | |
virtual void | notify (const TrainingResult &data) |
![]() | |
virtual void | notify (const TestInstanceResult &data) |
Static Public Member Functions | |
static FeatureExtraction * | createInstanceFromString (string const &featureExtractionType) |
![]() | |
static string | getGRTVersion (bool returnRevision=true) |
static string | getGRTRevison () |
Protected Member Functions | |
bool | init () |
bool | saveFeatureExtractionSettingsToFile (fstream &file) const |
bool | loadFeatureExtractionSettingsFromFile (fstream &file) |
![]() | |
bool | saveBaseSettingsToFile (fstream &file) const |
bool | loadBaseSettingsFromFile (fstream &file) |
![]() | |
double | SQR (const double &x) const |
Static Protected Member Functions | |
static StringFeatureExtractionMap * | getMap () |
Protected Attributes | |
string | featureExtractionType |
bool | initialized |
bool | featureDataReady |
VectorDouble | featureVector |
![]() | |
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< TrainingResult > | trainingResults |
TrainingResultsObserverManager | trainingResultsObserverManager |
TestResultsObserverManager | testResultsObserverManager |
![]() | |
string | classType |
DebugLog | debugLog |
ErrorLog | errorLog |
InfoLog | infoLog |
TrainingLog | trainingLog |
TestingLog | testingLog |
WarningLog | warningLog |
Definition at line 38 of file FeatureExtraction.h.
typedef std::map< string, FeatureExtraction*(*)() > GRT::FeatureExtraction::StringFeatureExtractionMap |
Defines a map between a string (which will contain the name of the featureExtraction module, such as FFT) and a function returns a new instance of that featureExtraction
Definition at line 154 of file FeatureExtraction.h.
GRT::FeatureExtraction::FeatureExtraction | ( | ) |
Default FeatureExtraction Constructor
Definition at line 41 of file FeatureExtraction.cpp.
|
virtual |
Default FeatureExtraction Destructor
Definition at line 53 of file FeatureExtraction.cpp.
|
virtual |
This function clears any previous setup.
Reimplemented from GRT::MLBase.
Reimplemented in GRT::FFT, GRT::RBMQuantizer, GRT::KMeansQuantizer, and GRT::SOMQuantizer.
Definition at line 104 of file FeatureExtraction.cpp.
|
inlinevirtual |
This function is called by the GestureRecognitionPipeline when any new input data needs to be processed (during the prediction phase for example). This function should be overwritten by the derived class.
const | VectorDouble &inputVector: the inputVector that should be processed |
Reimplemented in GRT::FFT, GRT::ZeroCrossingCounter, GRT::RBMQuantizer, GRT::KMeansQuantizer, GRT::SOMQuantizer, GRT::MovementTrajectoryFeatures, GRT::FFTFeatures, GRT::KMeansFeatures, GRT::MovementIndex, GRT::TimeseriesBuffer, and GRT::TimeDomainFeatures.
Definition at line 74 of file FeatureExtraction.h.
bool GRT::FeatureExtraction::copyBaseVariables | ( | const FeatureExtraction * | featureExtractionModule | ) |
This copies the FeatureExtraction variables from featureExtractionModule to the instance that calls the function.
const | FeatureExtraction *featureExtractionModule: a pointer to a feature extraction module from which the values will be copied |
Definition at line 60 of file FeatureExtraction.cpp.
FeatureExtraction * GRT::FeatureExtraction::createNewInstance | ( | ) | const |
Creates a new feature extraction instance based on the current featureExtractionType string value.
Definition at line 37 of file FeatureExtraction.cpp.
|
inlinevirtual |
This is the base deepCopyFrom function for the FeatureExtraction modules. This function should be overwritten by the derived class.
const | FeatureExtraction *featureExtraction: a pointer to the FeatureExtraction base class, this should be pointing to another instance of a matching derived class |
Reimplemented in GRT::FFT, GRT::ZeroCrossingCounter, GRT::KMeansQuantizer, GRT::RBMQuantizer, GRT::SOMQuantizer, GRT::FFTFeatures, GRT::MovementTrajectoryFeatures, GRT::KMeansFeatures, GRT::MovementIndex, GRT::TimeseriesBuffer, and GRT::TimeDomainFeatures.
Definition at line 57 of file FeatureExtraction.h.
bool GRT::FeatureExtraction::getFeatureDataReady | ( | ) | const |
Returns true if the feature extraction module has just processed the last input vector and a new output feature vector is ready.
Definition at line 177 of file FeatureExtraction.cpp.
string GRT::FeatureExtraction::getFeatureExtractionType | ( | ) | const |
Returns the feature extraction type as a string.
Definition at line 161 of file FeatureExtraction.cpp.
VectorDouble GRT::FeatureExtraction::getFeatureVector | ( | ) | const |
Returns the current feature vector.
Definition at line 181 of file FeatureExtraction.cpp.
bool GRT::FeatureExtraction::getInitialized | ( | ) | const |
Returns true if the feature extraction module has been initialized correctly.
Definition at line 173 of file FeatureExtraction.cpp.
UINT GRT::FeatureExtraction::getNumInputDimensions | ( | ) | const |
Returns the size of the input vector expected by the feature extraction module.
Definition at line 165 of file FeatureExtraction.cpp.
UINT GRT::FeatureExtraction::getNumOutputDimensions | ( | ) | const |
Returns the size of the feature vector that will be computed by the feature extraction module.
Definition at line 169 of file FeatureExtraction.cpp.
|
protected |
Initializes the base feature extraction module, this will resize the feature vector and get the instance ready for processing new data.
Definition at line 84 of file FeatureExtraction.cpp.
|
protected |
Loads the core base settings from a file.
Definition at line 130 of file FeatureExtraction.cpp.
|
inlinevirtual |
This loads the feature extraction settings from a file. This function should be overwritten by the derived class.
fstream | &file: a reference to the file to load the settings from |
Reimplemented from GRT::MLBase.
Reimplemented in GRT::FFT, GRT::RBMQuantizer, GRT::ZeroCrossingCounter, GRT::SOMQuantizer, GRT::MovementTrajectoryFeatures, GRT::FFTFeatures, GRT::KMeansFeatures, GRT::MovementIndex, GRT::KMeansQuantizer, GRT::TimeseriesBuffer, and GRT::TimeDomainFeatures.
Definition at line 107 of file FeatureExtraction.h.
|
inlinevirtual |
This function is called by the GestureRecognitionPipeline's reset function. This function should be overwritten by the derived class.
Reimplemented from GRT::MLBase.
Reimplemented in GRT::FFT, GRT::ZeroCrossingCounter, GRT::RBMQuantizer, GRT::KMeansQuantizer, GRT::SOMQuantizer, GRT::MovementTrajectoryFeatures, GRT::FFTFeatures, GRT::KMeansFeatures, GRT::MovementIndex, GRT::TimeseriesBuffer, and GRT::TimeDomainFeatures.
Definition at line 82 of file FeatureExtraction.h.
|
protected |
Saves the core base settings to a file.
Definition at line 116 of file FeatureExtraction.cpp.
|
inlinevirtual |
This saves the feature extraction settings to a file. This function should be overwritten by the derived class.
fstream | &file: a reference to the file to save the settings to |
Reimplemented from GRT::MLBase.
Reimplemented in GRT::FFT, GRT::RBMQuantizer, GRT::ZeroCrossingCounter, GRT::SOMQuantizer, GRT::MovementTrajectoryFeatures, GRT::FFTFeatures, GRT::KMeansFeatures, GRT::MovementIndex, GRT::KMeansQuantizer, GRT::TimeseriesBuffer, and GRT::TimeDomainFeatures.
Definition at line 98 of file FeatureExtraction.h.