![]() |
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 Member Functions | |
RadialBasisFunction (UINT numSteps=100, double positiveClassificationThreshold=0.9, double minAlphaSearchRange=0.001, double maxAlphaSearchRange=1.0) | |
virtual | ~RadialBasisFunction () |
RadialBasisFunction (const RadialBasisFunction &rhs) | |
RadialBasisFunction & | operator= (const RadialBasisFunction &rhs) |
virtual bool | deepCopyFrom (const WeakClassifier *weakClassifer) |
virtual bool | train (ClassificationData &trainingData, VectorDouble &weights) |
virtual double | predict (const VectorDouble &x) |
virtual bool | saveModelToFile (fstream &file) const |
virtual bool | loadModelFromFile (fstream &file) |
virtual void | print () const |
UINT | getNumSteps () const |
double | getPositiveClassificationThreshold () const |
double | getAlpha () const |
double | getMinAlphaSearchRange () const |
double | getMaxAlphaSearchRange () const |
VectorDouble | getRBFCentre () const |
![]() | |
WeakClassifier () | |
virtual | ~WeakClassifier () |
WeakClassifier (const WeakClassifier &rhs) | |
WeakClassifier & | operator= (const WeakClassifier &rhs) |
bool | copyBaseVariables (const WeakClassifier *weakClassifer) |
virtual double | getPositiveClassLabel () const |
virtual double | getNegativeClassLabel () const |
string | getWeakClassifierType () const |
bool | getTrained () const |
UINT | getNumInputDimensions () const |
WeakClassifier * | createNewInstance () const |
Protected Member Functions | |
double | rbf (const VectorDouble &a, const VectorDouble &b) |
Protected Attributes | |
UINT | numSteps |
double | positiveClassificationThreshold |
double | alpha |
double | gamma |
double | minAlphaSearchRange |
double | maxAlphaSearchRange |
VectorDouble | rbfCentre |
![]() | |
string | weakClassifierType |
A string that represents the weak classifier type, e.g. DecisionStump. | |
bool | trained |
A flag to show if the weak classifier model has been trained. | |
UINT | numInputDimensions |
The number of input dimensions to the weak classifier. | |
TrainingLog | trainingLog |
ErrorLog | errorLog |
WarningLog | warningLog |
Static Protected Attributes | |
static RegisterWeakClassifierModule< RadialBasisFunction > | registerModule |
This is used to register the DecisionStump with the WeakClassifier base class. | |
Additional Inherited Members | |
![]() | |
typedef std::map< string, WeakClassifier *(*)() > | StringWeakClassifierMap |
![]() | |
static WeakClassifier * | createInstanceFromString (string const &weakClassifierType) |
![]() | |
static StringWeakClassifierMap * | getMap () |
Definition at line 40 of file RadialBasisFunction.h.
GRT::RadialBasisFunction::RadialBasisFunction | ( | UINT | numSteps = 100 , |
double | positiveClassificationThreshold = 0.9 , |
||
double | minAlphaSearchRange = 0.001 , |
||
double | maxAlphaSearchRange = 1.0 |
||
) |
Default Constructor.
Sets the number of steps that will be used to search for the best alpha value during the training phase, in addition to other parameters used to control the RBF learning algorithm.
UINT | numSteps: sets the number of steps that will be used to search for the best alpha value during the training phase. Default value = 100 |
double | positiveClassificationThreshold: sets the positive classification threshold, this parameter is the threshold that defines if a value is classified as a positive sample or a negative sample. Default value = 0.9 |
double | minAlphaSearchRange: the minimum value used to search for the best alpha value. Default value = 0.001 |
double | maxAlphaSearchRange: the maximum value used to search for the best alpha value. Default value = 1.0 |
Definition at line 35 of file RadialBasisFunction.cpp.
|
virtual |
Default Destructor.
Definition at line 50 of file RadialBasisFunction.cpp.
GRT::RadialBasisFunction::RadialBasisFunction | ( | const RadialBasisFunction & | rhs | ) |
Default Copy Constructor. Defines how the data from the rhs GRT::RadialBasisFunction instance is copied to this GRT::RadialBasisFunction instance.
Definition at line 54 of file RadialBasisFunction.cpp.
|
virtual |
This function enables the data from one GRT::RadialBasisFunction instance to be copied into this GRT::RadialBasisFunction instance.
WeakClassifier | *weakClassifer: a pointer to the Classifier Base Class, this should be pointing to another GRT::RadialBasisFunction instance |
Reimplemented from GRT::WeakClassifier.
Definition at line 72 of file RadialBasisFunction.cpp.
double GRT::RadialBasisFunction::getAlpha | ( | ) | const |
Gets the current alpha value, this is used in the RBF. You can compute the RBF gamma parameter by: -1.0/(2.0*SQR(alpha)).
Definition at line 335 of file RadialBasisFunction.cpp.
double GRT::RadialBasisFunction::getMaxAlphaSearchRange | ( | ) | const |
Gets the maxAlphaSearchRange value, this is the maximum value used to search for the best alpha value.
Definition at line 343 of file RadialBasisFunction.cpp.
double GRT::RadialBasisFunction::getMinAlphaSearchRange | ( | ) | const |
Gets the minAlphaSearchRange value, this is the minimum value used to search for the best alpha value.
Definition at line 339 of file RadialBasisFunction.cpp.
UINT GRT::RadialBasisFunction::getNumSteps | ( | ) | const |
This function gets the number of steps parameter which sets how many steps are used to search for the best RBF alpha values.
Definition at line 327 of file RadialBasisFunction.cpp.
double GRT::RadialBasisFunction::getPositiveClassificationThreshold | ( | ) | const |
This function gets the positiveClassificationThreshold, if the output of the RBF function is greater than or equal to the positiveClassificationThreshold then the input sample will be classified as a positive sample, otherwise it will be classified as a negative sample.
Definition at line 331 of file RadialBasisFunction.cpp.
VectorDouble GRT::RadialBasisFunction::getRBFCentre | ( | ) | const |
Gets the RBF center.
Definition at line 323 of file RadialBasisFunction.cpp.
|
virtual |
This function loads an RBF model from a file.
fstream &file: a reference to the file you want to load the RBF model from
Reimplemented from GRT::WeakClassifier.
Definition at line 230 of file RadialBasisFunction.cpp.
RadialBasisFunction & GRT::RadialBasisFunction::operator= | ( | const RadialBasisFunction & | rhs | ) |
Defines how the data from the rhs GRT::RadialBasisFunction instance is copied to this GRT::RadialBasisFunction instance.
Definition at line 58 of file RadialBasisFunction.cpp.
|
virtual |
This function predicts the class label of the input vector, given the current RBF model. The class label returned will either be positive (WEAK_CLASSIFIER_POSITIVE_CLASS_LABEL) or negative (WEAK_CLASSIFIER_NEGATIVE_CLASS_LABEL).
const | VectorDouble &x: the vector used for prediction |
Reimplemented from GRT::WeakClassifier.
Definition at line 184 of file RadialBasisFunction.cpp.
|
virtual |
This function prints out some basic info about the RBF to std::cout.
Reimplemented from GRT::WeakClassifier.
Definition at line 320 of file RadialBasisFunction.cpp.
|
virtual |
This function saves the current RBF model to a file.
fstream &file: a reference to the file you want to save the RBF model to
Reimplemented from GRT::WeakClassifier.
Definition at line 199 of file RadialBasisFunction.cpp.
|
virtual |
This function trains the RBF, using the weighted labelled training data.
ClassificationData | &trainingData: the labelled training data |
VectorDouble | &weights: the corresponding weights for each sample in the labelled training data |
Reimplemented from GRT::WeakClassifier.
Definition at line 83 of file RadialBasisFunction.cpp.