C# Класс Accord.Statistics.Models.Markov.Learning.BaumWelchLearning

Baum-Welch learning algorithm for discrete-density Hidden Markov Models.

The Baum-Welch algorithm is an unsupervised algorithm used to learn a single hidden Markov model object from a set of observation sequences. It works by using a variant of the Expectation-Maximization algorithm to search a set of model parameters (i.e. the matrix of transition probabilities A, the matrix of emission probabilities B, and the initial probability vector π) that would result in a model having a high likelihood of being able to generate a set of training sequences given to this algorithm.

For increased accuracy, this class performs all computations using log-probabilities.

For a more thorough explanation on hidden Markov models with practical examples on gesture recognition, please see Sequence Classifiers in C#, Part I: Hidden Markov Models [1].

[1]: http://www.codeproject.com/Articles/541428/Sequence-Classifiers-in-Csharp-Part-I-Hidden-Marko

Наследование: BaseBaumWelchLearning, IUnsupervisedLearning, IConvergenceLearning
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BaumWelchLearning ( HiddenMarkovModel model ) : System

Creates a new instance of the Baum-Welch learning algorithm.

Run ( ) : double

Runs the Baum-Welch learning algorithm for hidden Markov models.

Learning problem. Given some training observation sequences O = {o1, o2, ..., oK} and general structure of HMM (numbers of hidden and visible states), determine HMM parameters M = (A, B, pi) that best fit training data.

Защищенные методы

Метод Описание
ComputeForwardBackward ( int index, double &fwd, double &bwd, double &scaling ) : void

Computes the forward and backward probabilities matrices for a given observation referenced by its index in the input training data.

ComputeKsi ( int index, double fwd, double bwd, double scaling ) : void

Computes the ksi matrix of probabilities for a given observation referenced by its index in the input training data.

UpdateEmissions ( ) : void

Updates the emission probability matrix.

Implementations of this method should use the observations in the training data and the Gamma probability matrix to update the probability distributions of symbol emissions.

Приватные методы

Метод Описание
IUnsupervisedLearning ( Array observations ) : double

Runs the Baum-Welch learning algorithm for hidden Markov models.

Learning problem. Given some training observation sequences O = {o1, o2, ..., oK} and general structure of HMM (numbers of hidden and visible states), determine HMM parameters M = (A, B, pi) that best fit training data.

Описание методов

BaumWelchLearning() публичный Метод

Creates a new instance of the Baum-Welch learning algorithm.
public BaumWelchLearning ( HiddenMarkovModel model ) : System
model Accord.Statistics.Models.Markov.HiddenMarkovModel
Результат System

ComputeForwardBackward() защищенный Метод

Computes the forward and backward probabilities matrices for a given observation referenced by its index in the input training data.
protected ComputeForwardBackward ( int index, double &fwd, double &bwd, double &scaling ) : void
index int The index of the observation in the input training data.
fwd double Returns the computed forward probabilities matrix.
bwd double Returns the computed backward probabilities matrix.
scaling double Returns the scaling parameters used during calculations.
Результат void

ComputeKsi() защищенный Метод

Computes the ksi matrix of probabilities for a given observation referenced by its index in the input training data.
protected ComputeKsi ( int index, double fwd, double bwd, double scaling ) : void
index int The index of the observation in the input training data.
fwd double The matrix of forward probabilities for the observation.
bwd double The matrix of backward probabilities for the observation.
scaling double The scaling vector computed in previous calculations.
Результат void

Run() публичный Метод

Runs the Baum-Welch learning algorithm for hidden Markov models.
Learning problem. Given some training observation sequences O = {o1, o2, ..., oK} and general structure of HMM (numbers of hidden and visible states), determine HMM parameters M = (A, B, pi) that best fit training data.
public Run ( ) : double
Результат double

UpdateEmissions() защищенный Метод

Updates the emission probability matrix.
Implementations of this method should use the observations in the training data and the Gamma probability matrix to update the probability distributions of symbol emissions.
protected UpdateEmissions ( ) : void
Результат void