![]() |
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, Regressifier *(*)() > | StringRegressifierMap |
![]() | |
enum | BaseTypes { BASE_TYPE_NOT_SET =0, CLASSIFIER, REGRESSIFIER, CLUSTERER } |
Public Member Functions | |
Regressifier (void) | |
virtual | ~Regressifier (void) |
virtual bool | deepCopyFrom (const Regressifier *regressifier) |
bool | copyBaseVariables (const Regressifier *regressifier) |
virtual bool | reset () |
virtual bool | clear () |
string | getRegressifierType () const |
VectorDouble | getRegressionData () const |
vector< MinMax > | getInputRanges () const |
vector< MinMax > | getOutputRanges () const |
Regressifier * | createNewInstance () const |
Regressifier * | deepCopy () const |
const Regressifier & | getBaseRegressifier () 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 | saveModelToFile (fstream &file) const |
virtual bool | loadModelFromFile (string filename) |
virtual bool | loadModelFromFile (fstream &file) |
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 Regressifier * | createInstanceFromString (string const ®ressifierType) |
static vector< string > | getRegisteredRegressifiers () |
![]() | |
static string | getGRTVersion (bool returnRevision=true) |
static string | getGRTRevison () |
Protected Member Functions | |
bool | saveBaseSettingsToFile (fstream &file) const |
bool | loadBaseSettingsFromFile (fstream &file) |
![]() | |
bool | saveBaseSettingsToFile (fstream &file) const |
bool | loadBaseSettingsFromFile (fstream &file) |
![]() | |
double | SQR (const double &x) const |
Static Protected Member Functions | |
static StringRegressifierMap * | getMap () |
Protected Attributes | |
string | regressifierType |
VectorDouble | regressionData |
vector< MinMax > | inputVectorRanges |
vector< MinMax > | targetVectorRanges |
![]() | |
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 43 of file Regressifier.h.
typedef std::map< string, Regressifier*(*)() > GRT::Regressifier::StringRegressifierMap |
Defines a map between a string (which will contain the name of the regressifier, such as LinearRegression) and a function returns a new instance of that regressifier
Definition at line 119 of file Regressifier.h.
GRT::Regressifier::Regressifier | ( | void | ) |
Default Regressifier Destructor
Definition at line 53 of file Regressifier.cpp.
|
virtual |
Default Regressifier Destructor
Definition at line 60 of file Regressifier.cpp.
|
virtual |
This function clears the regressifier module, removing any trained model and setting all the base variables to their default values.
Reimplemented from GRT::MLBase.
Reimplemented in GRT::RegressionTree, and GRT::MLP.
Definition at line 96 of file Regressifier.cpp.
bool GRT::Regressifier::copyBaseVariables | ( | const Regressifier * | regressifier | ) |
This copies the Regressifier variables from the regressifier pointer to this instance.
const | Regressifier *regressifier: a pointer to a regressifier from which the values will be copied to this instance |
Definition at line 67 of file Regressifier.cpp.
|
static |
Creates a new regressifier instance based on the input string (which should contain the name of a valid regressifier such as LinearRegression).
string | const ®ressifierType: the name of the regressifier |
Definition at line 27 of file Regressifier.cpp.
Regressifier * GRT::Regressifier::createNewInstance | ( | ) | const |
Creates a new regressifier instance based on the current regressifierType string value.
Definition at line 36 of file Regressifier.cpp.
Regressifier * GRT::Regressifier::deepCopy | ( | ) | const |
This creates a new Regressifier instance and deep copies the variables and models from this instance into the deep copy. The function will then return a pointer to the new instance. It is up to the user who calls this function to delete the dynamic instance when they are finished using it.
Definition at line 40 of file Regressifier.cpp.
|
inlinevirtual |
This is the base deep copy function for the Regressifier modules. This function should be overwritten by the derived class. This deep copies the variables and models from the regressifier pointer to this regressifier instance.
const | Regressifier *regressifier: a pointer to the Regressifier base class, this should be pointing to another instance of a matching derived class |
Reimplemented in GRT::RegressionTree, GRT::MultidimensionalRegression, GRT::MLP, GRT::LinearRegression, and GRT::LogisticRegression.
Definition at line 63 of file Regressifier.h.
const Regressifier & GRT::Regressifier::getBaseRegressifier | ( | ) | const |
Returns a pointer to this regressifier. This is useful for a derived class so it can get easy access to this base regressifier.
Definition at line 130 of file Regressifier.cpp.
vector< MinMax > GRT::Regressifier::getInputRanges | ( | ) | const |
Returns the ranges of the input (i.e. feature) data.
Definition at line 122 of file Regressifier.cpp.
vector< MinMax > GRT::Regressifier::getOutputRanges | ( | ) | const |
Returns the ranges of the output (i.e. target) data.
Definition at line 126 of file Regressifier.cpp.
|
static |
Returns a vector of the names of all regressifiers that have been registered with the base regressifier.
string GRT::Regressifier::getRegressifierType | ( | ) | const |
Gets the regressifier type as a string. This is the name of the regression algorithm, such as "LinearRegression".
Definition at line 111 of file Regressifier.cpp.
VectorDouble GRT::Regressifier::getRegressionData | ( | ) | const |
Gets a vector containing the regression data output by the regression algorithm, this will be an M-dimensional vector, where M is the number of output dimensions in the model.
Definition at line 115 of file Regressifier.cpp.
|
protected |
Loads the core base settings from a file.
Definition at line 161 of file Regressifier.cpp.
|
virtual |
This resets the regressifier. This overrides the reset function in the MLBase base class.
Reimplemented from GRT::MLBase.
Definition at line 86 of file Regressifier.cpp.
|
protected |
Saves the core base settings to a file.
Definition at line 135 of file Regressifier.cpp.