|
latest version v1.9 - last update 24 Nov 2005 |
|
#include <ltiHmmClassifier.h>
Inheritance diagram for lti::hmmClassifier:


Public Member Functions | |
| hmmClassifier () | |
| hmmClassifier (const hmmClassifier &other) | |
| virtual | ~hmmClassifier () |
| virtual const char * | getTypeName () const |
| hmmClassifier & | copy (const hmmClassifier &other) |
| hmmClassifier & | operator= (const hmmClassifier &other) |
| virtual classifier * | clone () const |
| const parameters & | getParameters () const |
| virtual bool | write (ioHandler &handler, const bool complete=true) const |
| virtual bool | read (ioHandler &handler, const bool complete=true) |
Training routines | |
These methods are needed to train Hidden Markov models. | |
| virtual bool | train (const std::vector< sequence< dvector > > &input, const ivector &ids) |
| bool | train (std::vector< sequence< dvector > > &input, int id) |
| void | reset () |
Classification routines. | |
These methods are used for classification. | |
| virtual bool | classify (const sequence< dvector > &observations, outputVector &result) |
| bool | reducedClassify (const sequence< dvector > &observations, outputVector &result, std::map< int, std::string > usedModelsIDNameMap) |
Direct access routines | |
These methods are used to directly access/change the Hidden Markov models used internally. Note that changing single models may lead to incorrect output templates! | |
| ivector | getIDs () |
| hiddenMarkovModel | getHMM (int id) const |
| bool | setHMM (hiddenMarkovModel &model, int id) |
| bool | deleteHMM (int id) |
| void | setName (int id, const std::string &theName) |
| void | generateIndexNameMap (std::map< int, std::string > &theMap) const |
| int | getShortestModelLength () const |
Protected Attributes | |
| std::map< int, hiddenMarkovModel > | theModels |
| int | featureDimension |
Classes | |
| class | parameters |
| the parameters for the class hmmClassifier More... | |
The algorithms are taken from "Fundamentals of speech recognition" (L. Rabiner and B.-H. Juang, Prentice Hall, 1993) and can also be found in "Erkennung kontinuierlicher Gebärdensprache mit Ganzwortmodellen" (H. C. Hienz, PhD thesis, Chair of Technical Computer Science, 2000). The notation in this documentation is taken from the latter literature.
In case of classification, the probability
of the observation sequence
is approximated by the observation probability
of the best path
. The best path is found with the Viterbi algorithm. Increased computational efficiency and precision are achieved by using scores with
instead of probabilities. Note that the lowest score corresponds to the highest probability and thus represents the best recognition result.
Note: The values in the outputVector are not probabilities! To match the value criteria (higher values represent better recognition results, positive values only), scores are mapped to values between 0.0 and 1.0. Currently exponential, linear, and none are available.
|
|
default constructor
|
|
|
copy constructor
|
|
|
destructor
|
|
||||||||||||
|
Classification. Classifies the sequence of features and returns the outputVector with the classification result.
Implements lti::supervisedSequenceClassifier. |
|
|
returns a pointer to a clone of this functor.
Implements lti::classifier. Reimplemented in lti::hmmOnlineClassifier. |
|
|
copy data of "other" functor.
|
|
|
Delete the model with the given id. Note: the output template may contain incorrect values after this!
|
|
|
Generate a map ID -> name for all loaded models.
|
|
|
Returns a copy of the model with the given id. If no such model exists, the empty default model given in parameters is returned. |
|
|
Query id's of trained models.
|
|
|
returns used parameters
Reimplemented from lti::supervisedSequenceClassifier. Reimplemented in lti::hmmOnlineClassifier. |
|
|
Returns the length of the shortest model. This allows to tell if an observation of a certain length can be classified by this classifier. If no models are available, -1 will be returned. |
|
|
returns the name of this type ("hmmClassifier")
Reimplemented from lti::supervisedSequenceClassifier. Reimplemented in lti::hmmOnlineClassifier. |
|
|
alias for copy member
|
|
||||||||||||
|
read method
Reimplemented from lti::classifier. Reimplemented in lti::hmmOnlineClassifier. |
|
||||||||||||||||
|
Reduced Classification. Classifies the sequence of features only with a reduced number of models given in usedModelsIDNameMap. Returns the outputVector with the classification result.
|
|
|
Deletes all models saved internally.
Reimplemented in lti::hmmOnlineClassifier. |
|
||||||||||||
|
Set the model to be used for the given id. Note: the output template may contain incorrect values hereafter!
|
|
||||||||||||
|
Set the name of a specific model (if a model with the given ID exists).
|
|
||||||||||||
|
Training of a single model. The given sequences are used to train the model of the given id. If such a model already exists internally, it will be overwritten. Training is performed with the training parameters given in the parameters class. Note: if you train a single model this way, the output template may contain incorrect values! |
|
||||||||||||
|
Supervised sequence training.
The sequences in the
Implements lti::supervisedSequenceClassifier. |
|
||||||||||||
|
write method
Reimplemented from lti::classifier. Reimplemented in lti::hmmOnlineClassifier. |
|
|
feature dimension (saved here for faster access)
|
|
|
the models with the given ids.
|