class HMM

This class implements a Hidden Markov Model distribution.

Inheritance:


Public Fields

[more]SeqDataSet* data
keep the training data to compute the size of the longest sequence
[more]int n_states
The number of states of the HMM.
[more]real prior_transitions
a prior on the transition probabilities
[more]Distribution** states
keep the emission distributions
[more]Distribution** unique_states
in the case where the emission distribution share their parameters, unique_states contains the prototypes which will be used for updates (otherwise, it is a pointer to states).
[more]int n_unique_states
if unique_states is given, n_unique_states is its size
[more]real** transitions
the initial transitions between states are kept as a matrix
[more]real** log_transitions
in fact, we keep the transitions in log
[more]real** dlog_transitions
the derivative of the log transitions for gradient descent
[more]real** transitions_acc
the accumulators of the transitions for EM
[more]real** log_alpha
accumulator used in the forward phase to compute log likelihood
[more]real** log_beta
accumulator used in the backward phase to compute log likelihood
[more]int** arg_viterbi
for each state, for each time step, keep the best predecessor
[more]int* viterbi_sequence
for each time step, keep the best state
[more]real** log_probabilities_s
keep for each time step and each model its emission log probability

Public Methods

[more]virtual void printTransitions(bool real_values=false, bool transitions_only=false)
this method can be used for debugging purpose to see the transitions
[more]virtual void logAlpha(SeqExample* ex)
computes the log_alpha during forward phase of EM
[more]virtual void logBeta(SeqExample* ex)
computes the log_beta during backward phase of EM
[more]virtual void logViterbi(SeqExample* ex)
computes the log_viterbi during forward phase of Viterbi
[more]virtual void decode(List* input)
this method returns the state sequence associated to the input
[more]virtual void logProbabilities(List* inputs)
computes for each state and each time step of the sequence inputs its associated emission probability


Inherited from Distribution:

Public Fields

oint n_observations
oint tot_n_frames
oint max_n_frames
oreal log_probability
oreal* log_probabilities

Public Methods

ovirtual real logProbability(List* inputs)
ovirtual real viterbiLogProbability(List* inputs)
ovirtual real frameLogProbability(real* observations, real* inputs, int t)
ovirtual void frameExpectation(real* observations, real* inputs, int t)
ovirtual void eMIterInitialize()
ovirtual void iterInitialize()
ovirtual void eMSequenceInitialize(List* inputs)
ovirtual void sequenceInitialize(List* inputs)
ovirtual void eMAccPosteriors(List* inputs, real log_posterior)
ovirtual void frameEMAccPosteriors(real* observations, real log_posterior, real* inputs, int t)
ovirtual void viterbiAccPosteriors(List* inputs, real log_posterior)
ovirtual void frameViterbiAccPosteriors(real* observations, real log_posterior, real* inputs, int t)
ovirtual void eMUpdate()
ovirtual void eMForward(List* inputs)
ovirtual void viterbiForward(List* inputs)
ovirtual void frameBackward(real* observations, real* alpha, real* inputs, int t)
ovirtual void viterbiBackward(List* inputs, real* alpha)


Inherited from GradientMachine:

Public Fields

obool is_free
oList* params
oList* der_params
oint n_params
oreal* beta

Public Methods

ovirtual void init()
ovirtual int numberOfParams()
ovirtual void backward(List* inputs, real* alpha)
ovirtual void allocateMemory()
ovirtual void freeMemory()
ovirtual void loadFILE(FILE* file)
ovirtual void saveFILE(FILE* file)


Inherited from Machine:

Public Fields

oint n_inputs
oint n_outputs
oList* outputs

Public Methods

ovirtual void forward(List* inputs)
ovirtual void reset()


Inherited from Object:

Public Methods

ovoid addOption(const char* name, int size, void* ptr, const char* help="", bool is_allowed_after_init=false)
ovoid addIOption(const char* name, int* ptr, int init_value, const char* help="", bool is_allowed_after_init=false)
ovoid addROption(const char* name, real* ptr, real init_value, const char* help="", bool is_allowed_after_init=false)
ovoid addBOption(const char* name, bool* ptr, bool init_value, const char* help="", bool is_allowed_after_init=false)
ovoid setOption(const char* name, void* ptr)
ovoid setIOption(const char* name, int option)
ovoid setROption(const char* name, real option)
ovoid setBOption(const char* name, bool option)
ovoid load(const char* filename)
ovoid save(const char* filename)


Documentation

This class implements a Hidden Markov Model distribution. In fact, it also implements the Input Output version (IOHMM). It can be trained either by EM, Viterbi, or Gradient Descent.

Note that this kind of HMM always contain one initial state and one final state. Both are non-emitting.

oSeqDataSet* data
keep the training data to compute the size of the longest sequence

oint n_states
The number of states of the HMM. the first model is the initial state, the last model is the final (absorbing) state, (neither of them are emitting). hence, n_states > 2

oreal prior_transitions
a prior on the transition probabilities

oDistribution** states
keep the emission distributions

oDistribution** unique_states
in the case where the emission distribution share their parameters, unique_states contains the prototypes which will be used for updates (otherwise, it is a pointer to states). Note that if given, and as for states, unique_states contains an empty state for positions 0 (initial state) and n_states - 1 (final state)

oint n_unique_states
if unique_states is given, n_unique_states is its size

oreal** transitions
the initial transitions between states are kept as a matrix

oreal** log_transitions
in fact, we keep the transitions in log

oreal** dlog_transitions
the derivative of the log transitions for gradient descent

oreal** transitions_acc
the accumulators of the transitions for EM

oreal** log_alpha
accumulator used in the forward phase to compute log likelihood

oreal** log_beta
accumulator used in the backward phase to compute log likelihood

oint** arg_viterbi
for each state, for each time step, keep the best predecessor

oint* viterbi_sequence
for each time step, keep the best state

oreal** log_probabilities_s
keep for each time step and each model its emission log probability

ovirtual void printTransitions(bool real_values=false, bool transitions_only=false)
this method can be used for debugging purpose to see the transitions

ovirtual void logAlpha(SeqExample* ex)
computes the log_alpha during forward phase of EM

ovirtual void logBeta(SeqExample* ex)
computes the log_beta during backward phase of EM

ovirtual void logViterbi(SeqExample* ex)
computes the log_viterbi during forward phase of Viterbi

ovirtual void decode(List* input)
this method returns the state sequence associated to the input

ovirtual void logProbabilities(List* inputs)
computes for each state and each time step of the sequence inputs its associated emission probability


Direct child classes:
SpeechHMM
Author:
Samy Bengio (bengio@idiap.ch)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.