GestureRecognitionToolkit
Version: 0.2.5
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
KMeansFeatures.h
Go to the documentation of this file.
1
29
#ifndef GRT_KMEANS_FEATURES_HEADER
30
#define GRT_KMEANS_FEATURES_HEADER
31
32
//Include the main GRT header to get access to the FeatureExtraction base class
33
#include "../../CoreModules/FeatureExtraction.h"
34
#include "../../ClusteringModules/KMeans/KMeans.h"
35
#include "../../DataStructures/TimeSeriesClassificationData.h"
36
#include "../../DataStructures/ClassificationDataStream.h"
37
#include "../../DataStructures/UnlabelledData.h"
38
39
GRT_BEGIN_NAMESPACE
40
41
class
GRT_API
KMeansFeatures
:
public
FeatureExtraction
{
42
public
:
49
KMeansFeatures
(
const
Vector< UINT >
numClustersPerLayer =
Vector< UINT >
(1,100),
const
Float alpha = 0.2,
const
bool
useScaling =
true
);
50
56
KMeansFeatures
(
const
KMeansFeatures
&rhs);
57
61
virtual
~
KMeansFeatures
();
62
69
KMeansFeatures
& operator=(
const
KMeansFeatures
&rhs);
70
79
virtual
bool
deepCopyFrom
(
const
FeatureExtraction
*featureExtraction)
override
;
80
89
virtual
bool
computeFeatures
(
const
VectorFloat
&inputVector)
override
;
90
98
virtual
bool
reset
()
override
;
99
108
virtual
bool
save
( std::fstream &file )
const override
;
109
117
virtual
bool
load
( std::fstream &file )
override
;
118
125
virtual
bool
train_
(
ClassificationData
&trainingData)
override
;
126
133
virtual
bool
train_
(
TimeSeriesClassificationData
&trainingData)
override
;
134
141
virtual
bool
train_
(
ClassificationDataStream
&trainingData)
override
;
142
149
virtual
bool
train_
(
UnlabelledData
&trainingData)
override
;
150
157
virtual
bool
train_
(
MatrixFloat
&trainingData)
override
;
158
159
bool
init
(
const
Vector< UINT >
&numClustersPerLayer );
160
161
bool
projectDataThroughLayer(
const
VectorFloat
&input,
VectorFloat
&output,
const
UINT layer );
162
163
UINT getNumLayers()
const
;
164
UINT getLayerSize(
const
UINT layerIndex)
const
;
165
Vector< MatrixFloat >
getClusters()
const
;
166
167
//Tell the compiler we are using the following functions from the MLBase class to stop hidden virtual function warnings
168
using
MLBase::save
;
169
using
MLBase::load
;
170
using
MLBase::train
;
171
using
MLBase::train_
;
172
using
MLBase::predict
;
173
using
MLBase::predict_
;
174
180
static
std::string
getId
();
181
182
protected
:
183
Float alpha;
184
Vector< UINT >
numClustersPerLayer;
185
Vector< MinMax >
ranges;
186
Vector< MatrixFloat >
clusters;
187
188
private
:
189
static
RegisterFeatureExtractionModule< KMeansFeatures >
registerModule;
190
static
std::string id;
191
};
192
193
GRT_END_NAMESPACE
194
195
#endif //GRT_KMEANS_FEATURES_HEADER
GRTBase::getId
std::string getId() const
Definition:
GRTBase.cpp:85
MLBase::predict
virtual bool predict(VectorFloat inputVector)
Definition:
MLBase.cpp:135
MLBase::predict_
virtual bool predict_(VectorFloat &inputVector)
Definition:
MLBase.cpp:137
MLBase::reset
virtual bool reset()
Definition:
MLBase.cpp:147
MatrixFloat
Definition:
MatrixFloat.h:36
FeatureExtraction::init
bool init()
Definition:
FeatureExtraction.cpp:86
ClassificationDataStream
Definition:
ClassificationDataStream.h:42
MLBase::train
virtual bool train(ClassificationData trainingData)
Definition:
MLBase.cpp:107
MLBase::save
virtual bool save(const std::string &filename) const
Definition:
MLBase.cpp:167
UnlabelledData
Definition:
UnlabelledData.h:38
FeatureExtraction::computeFeatures
virtual bool computeFeatures(const VectorFloat &inputVector)
Definition:
FeatureExtraction.h:75
RegisterFeatureExtractionModule< KMeansFeatures >
ClassificationData
Definition:
ClassificationData.h:43
KMeansFeatures
Definition:
KMeansFeatures.h:41
FeatureExtraction
Definition:
FeatureExtraction.h:38
VectorFloat
Definition:
VectorFloat.h:33
MLBase::train_
virtual bool train_(ClassificationData &trainingData)
Definition:
MLBase.cpp:109
TimeSeriesClassificationData
Definition:
TimeSeriesClassificationData.h:42
Vector< UINT >
MLBase::load
virtual bool load(const std::string &filename)
Definition:
MLBase.cpp:190
FeatureExtraction::deepCopyFrom
virtual bool deepCopyFrom(const FeatureExtraction *rhs)
Definition:
FeatureExtraction.h:58
GRT
FeatureExtractionModules
KMeansFeatures
KMeansFeatures.h
Generated on Mon Jan 2 2017 16:24:35 for GestureRecognitionToolkit by
1.8.11