-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from vikdoro/devs
Add HMM and quantizer
- Loading branch information
Showing
15 changed files
with
838 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef NODE_HMM_H | ||
#define NODE_HMM_H | ||
|
||
#include <nan.h> | ||
#include <GRT/GRT.h> | ||
|
||
class NodeHMM : public Nan::ObjectWrap { | ||
public: | ||
static NAN_MODULE_INIT(Init); | ||
|
||
private: | ||
explicit NodeHMM(); | ||
~NodeHMM(); | ||
|
||
static NAN_METHOD(New); | ||
static NAN_METHOD(Train); | ||
static NAN_METHOD(SetHMMType); | ||
static NAN_METHOD(SetNumStates); | ||
static NAN_METHOD(SetNumSymbols); | ||
static NAN_METHOD(SetModelType); | ||
static NAN_METHOD(SetMinChange); | ||
static NAN_METHOD(SetMaxNumEpochs); | ||
static NAN_METHOD(SetNumRandomTrainingIterations); | ||
static NAN_METHOD(Predict); | ||
static NAN_METHOD(GetPredictedClassLabel); | ||
static NAN_METHOD(GetClassLikelihoods); | ||
static Nan::Persistent<v8::Function> constructor; | ||
GRT::HMM *hmm; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef NODE_K_MEANS_QUANTIZER_H | ||
#define NODE_K_MEANS_QUANTIZER_H | ||
|
||
#include <nan.h> | ||
#include <GRT/GRT.h> | ||
|
||
class NodeKMeansQuantizer : public Nan::ObjectWrap { | ||
public: | ||
static NAN_MODULE_INIT(Init); | ||
|
||
private: | ||
explicit NodeKMeansQuantizer(); | ||
explicit NodeKMeansQuantizer(const uint numClusters); | ||
~NodeKMeansQuantizer(); | ||
|
||
static NAN_METHOD(New); | ||
static NAN_METHOD(Train); | ||
static NAN_METHOD(Quantize); | ||
static NAN_METHOD(GetFeatureVector); | ||
static NAN_METHOD(Clear); | ||
|
||
static Nan::Persistent<v8::Function> constructor; | ||
GRT::KMeansQuantizer *kmeansquantizer; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
var NativeExtension = require('bindings')('NativeExtension'); | ||
module.exports = NativeExtension; | ||
var GRT = require('bindings')('GRT'); | ||
|
||
// HMM types to use for setHMMType method of HMM class | ||
GRT.HMM_CONTINUOUS = 1; // default | ||
GRT.HMM_DISCRETE = 0; | ||
|
||
// Model types to use for setModelType method of HMM class | ||
GRT.HMM_LEFTRIGHT = 1; // default | ||
GRT.HMM_ERGODIC = 0; | ||
module.exports = GRT; |
Oops, something went wrong.