mlpack
|
#include <mlpack/prereqs.hpp>
#include <mlpack/core/util/io.hpp>
#include <mlpack/core/util/mlpack_main.hpp>
#include "hmm.hpp"
#include "hmm_model.hpp"
#include <mlpack/methods/gmm/gmm.hpp>
#include <mlpack/methods/gmm/diagonal_gmm.hpp>
Classes | |
struct | Init |
struct | Train |
Functions | |
BINDING_NAME ("Hidden Markov Model (HMM) Training") | |
BINDING_SHORT_DESC ("An implementation of training algorithms for Hidden Markov Models (HMMs). " "Given labeled or unlabeled data, an HMM can be trained for further use " "with other mlpack HMM tools.") | |
BINDING_LONG_DESC ("This program allows a Hidden Markov Model to be trained on labeled or " "unlabeled data. It supports four types of HMMs: Discrete HMMs, " "Gaussian HMMs, GMM HMMs, or Diagonal GMM HMMs" "\" "Either one input sequence can be specified (with "+PRINT_PARAM_STRING("input_file")+"), or, a file containing files in " "which input sequences can be found (when "+PRINT_PARAM_STRING("input_file")+"and"+PRINT_PARAM_STRING("batch")+" are used together). In addition, labels can be " "provided in the file specified by "+PRINT_PARAM_STRING("labels_file")+", and if "+PRINT_PARAM_STRING("batch")+" is used, " "the file given to "+PRINT_PARAM_STRING("labels_file")+" should contain a list of files of labels corresponding to the sequences" " in the file given to "+PRINT_PARAM_STRING("input_file")+"." "\" "The HMM is trained with the Baum-Welch algorithm if no labels are " "provided. The tolerance of the Baum-Welch algorithm can be set with the "+PRINT_PARAM_STRING("tolerance")+"option. By default, the transition " "matrix is randomly initialized and the emission distributions are " "initialized to fit the extent of the data." "\" "Optionally, a pre-created HMM model can be used as a guess for the " "transition matrix and emission probabilities; this is specifiable with "+PRINT_PARAM_STRING("output_model")+".") | |
BINDING_SEE_ALSO ("@hmm_generate", "#hmm_generate") | |
BINDING_SEE_ALSO ("@hmm_loglik", "#hmm_loglik") | |
BINDING_SEE_ALSO ("@hmm_viterbi", "#hmm_viterbi") | |
BINDING_SEE_ALSO ("Hidden Mixture Models on Wikipedia", "https://en.wikipedia.org/wiki/Hidden_Markov_model") | |
BINDING_SEE_ALSO ("mlpack::hmm::HMM class documentation", "@doxygen/classmlpack_1_1hmm_1_1HMM.html") | |
PARAM_STRING_IN_REQ ("input_file", "File containing input observations.", "i") | |
PARAM_STRING_IN ("type", "Type of HMM: discrete | gaussian | diag_gmm | gmm.", "t", "gaussian") | |
PARAM_FLAG ("batch", "If true, input_file (and if passed, labels_file) are " "expected to contain a list of files to use as input observation sequences " "(and label sequences).", "b") | |
PARAM_INT_IN ("states", "Number of hidden states in HMM (necessary, unless " "model_file is specified).", "n", 0) | |
PARAM_INT_IN ("gaussians", "Number of gaussians in each GMM (necessary when type" " is 'gmm').", "g", 0) | |
PARAM_MODEL_IN (HMMModel, "input_model", "Pre-existing HMM model to initialize " "training with.", "m") | |
PARAM_STRING_IN ("labels_file", "Optional file of hidden states, used for " "labeled training.", "l", "") | |
PARAM_MODEL_OUT (HMMModel, "output_model", "Output for trained HMM.", "M") | |
PARAM_INT_IN ("seed", "Random seed. If 0, 'std::time(NULL)' is used.", "s", 0) | |
PARAM_DOUBLE_IN ("tolerance", "Tolerance of the Baum-Welch algorithm.", "T", 1e-5) | |
Executable which trains an HMM and saves the trained HMM to file.
mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.