GestureRecognitionToolkit
Version: 0.1.0
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< std::string, Regressifier *(*)() > | StringRegressifierMap |
Public Types inherited from MLBase | |
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 () |
std::string | getRegressifierType () const |
VectorFloat | getRegressionData () const |
Vector< MinMax > | getInputRanges () const |
Vector< MinMax > | getOutputRanges () const |
Regressifier * | createNewInstance () const |
Regressifier * | deepCopy () const |
const Regressifier & | getBaseRegressifier () const |
Public Member Functions inherited from 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 (ClassificationDataStream trainingData) |
virtual bool | train_ (ClassificationDataStream &trainingData) |
virtual bool | train (UnlabelledData trainingData) |
virtual bool | train_ (UnlabelledData &trainingData) |
virtual bool | train (MatrixFloat data) |
virtual bool | train_ (MatrixFloat &data) |
virtual bool | predict (VectorFloat inputVector) |
virtual bool | predict_ (VectorFloat &inputVector) |
virtual bool | predict (MatrixFloat inputMatrix) |
virtual bool | predict_ (MatrixFloat &inputMatrix) |
virtual bool | map (VectorFloat inputVector) |
virtual bool | map_ (VectorFloat &inputVector) |
virtual bool | print () const |
virtual bool | save (const std::string filename) const |
virtual bool | load (const std::string filename) |
virtual bool | saveModelToFile (std::string filename) const |
virtual bool | saveModelToFile (std::fstream &file) const |
virtual bool | loadModelFromFile (std::string filename) |
virtual bool | loadModelFromFile (std::fstream &file) |
virtual bool | getModel (std::ostream &stream) const |
Float | scale (const Float &x, const Float &minSource, const Float &maxSource, const Float &minTarget, const Float &maxTarget, const bool constrain=false) |
virtual std::string | getModelAsString () const |
DataType | getInputType () const |
DataType | getOutputType () 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 |
Float | getMinChange () const |
Float | getLearningRate () const |
Float | getRootMeanSquaredTrainingError () const |
Float | getTotalSquaredTrainingError () const |
Float | getValidationSetAccuracy () const |
VectorFloat | getValidationSetPrecision () const |
VectorFloat | getValidationSetRecall () 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 (const bool useScaling) |
bool | setMaxNumEpochs (const UINT maxNumEpochs) |
bool | setMinNumEpochs (const UINT minNumEpochs) |
bool | setMinChange (const Float minChange) |
bool | setLearningRate (const Float learningRate) |
bool | setUseValidationSet (const bool useValidationSet) |
bool | setValidationSetSize (const UINT validationSetSize) |
bool | setRandomiseTrainingOrder (const bool randomiseTrainingOrder) |
bool | setTrainingLoggingEnabled (const bool loggingEnabled) |
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 |
Public Member Functions inherited from GRTBase | |
GRTBase (void) | |
virtual | ~GRTBase (void) |
bool | copyGRTBaseVariables (const GRTBase *GRTBase) |
std::string | getClassType () const |
std::string | getLastWarningMessage () const |
std::string | getLastErrorMessage () const |
std::string | getLastInfoMessage () const |
bool | setInfoLoggingEnabled (const bool loggingEnabled) |
bool | setWarningLoggingEnabled (const bool loggingEnabled) |
bool | setErrorLoggingEnabled (const bool loggingEnabled) |
GRTBase * | getGRTBasePointer () |
const GRTBase * | getGRTBasePointer () const |
Public Member Functions inherited from Observer< TrainingResult > | |
virtual void | notify (const TrainingResult &data) |
Public Member Functions inherited from Observer< TestInstanceResult > | |
virtual void | notify (const TestInstanceResult &data) |
Static Public Member Functions | |
static Regressifier * | createInstanceFromString (const std::string ®ressifierType) |
static Vector< std::string > | getRegisteredRegressifiers () |
Static Public Member Functions inherited from GRTBase | |
static std::string | getGRTVersion (bool returnRevision=true) |
static std::string | getGRTRevison () |
Protected Member Functions | |
bool | saveBaseSettingsToFile (std::fstream &file) const |
bool | loadBaseSettingsFromFile (std::fstream &file) |
Protected Member Functions inherited from MLBase | |
bool | saveBaseSettingsToFile (std::fstream &file) const |
bool | loadBaseSettingsFromFile (std::fstream &file) |
Protected Member Functions inherited from GRTBase | |
Float | SQR (const Float &x) const |
Static Protected Member Functions | |
static StringRegressifierMap * | getMap () |
Protected Attributes | |
std::string | regressifierType |
VectorFloat | regressionData |
Vector< MinMax > | inputVectorRanges |
Vector< MinMax > | targetVectorRanges |
Protected Attributes inherited from MLBase | |
bool | trained |
bool | useScaling |
DataType | inputType |
DataType | outputType |
UINT | baseType |
UINT | numInputDimensions |
UINT | numOutputDimensions |
UINT | numTrainingIterationsToConverge |
UINT | minNumEpochs |
UINT | maxNumEpochs |
UINT | validationSetSize |
Float | learningRate |
Float | minChange |
Float | rootMeanSquaredTrainingError |
Float | totalSquaredTrainingError |
Float | validationSetAccuracy |
bool | useValidationSet |
bool | randomiseTrainingOrder |
VectorFloat | validationSetPrecision |
VectorFloat | validationSetRecall |
Random | random |
std::vector< TrainingResult > | trainingResults |
TrainingResultsObserverManager | trainingResultsObserverManager |
TestResultsObserverManager | testResultsObserverManager |
Protected Attributes inherited from GRTBase | |
std::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< std::string, Regressifier*(*)() > 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.
Regressifier::Regressifier | ( | void | ) |
Default Regressifier Destructor
Definition at line 54 of file Regressifier.cpp.
|
virtual |
Default Regressifier Destructor
Definition at line 61 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 MLBase.
Reimplemented in RegressionTree, and MLP.
Definition at line 97 of file Regressifier.cpp.
bool Regressifier::copyBaseVariables | ( | const Regressifier * | regressifier | ) |
This copies the Regressifier variables from the regressifier pointer to this instance.
regressifier | a pointer to a regressifier from which the values will be copied to this instance |
Definition at line 68 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).
regressifierType | the name of the regressifier |
Definition at line 28 of file Regressifier.cpp.
Regressifier * Regressifier::createNewInstance | ( | ) | const |
Creates a new regressifier instance based on the current regressifierType string value.
Definition at line 37 of file Regressifier.cpp.
Regressifier * 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 41 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.
regressifier | a pointer to the Regressifier base class, this should be pointing to another instance of a matching derived class |
Reimplemented in RegressionTree, MultidimensionalRegression, MLP, LinearRegression, and LogisticRegression.
Definition at line 63 of file Regressifier.h.
const Regressifier & 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 131 of file Regressifier.cpp.
Returns the ranges of the input (i.e. feature) data.
Definition at line 123 of file Regressifier.cpp.
Returns the ranges of the output (i.e. target) data.
Definition at line 127 of file Regressifier.cpp.
|
static |
std::string Regressifier::getRegressifierType | ( | ) | const |
Gets the regressifier type as a string. This is the name of the regression algorithm, such as "LinearRegression".
Definition at line 112 of file Regressifier.cpp.
VectorFloat 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 116 of file Regressifier.cpp.
|
protected |
Loads the core base settings from a file.
Definition at line 162 of file Regressifier.cpp.
|
virtual |
This resets the regressifier. This overrides the reset function in the MLBase base class.
Reimplemented from MLBase.
Definition at line 87 of file Regressifier.cpp.
|
protected |
Saves the core base settings to a file.
Definition at line 136 of file Regressifier.cpp.