class HMM

This class implements a Hidden Markov Model distribution.

Inheritance:


Public Fields

[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** shared_states
if the states are in fact shared in some way or another, the original ones are in shared_states
[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]Sequence* log_alpha
accumulator used in the forward phase to compute log likelihood
[more]Sequence* log_beta
accumulator used in the backward phase to compute log likelihood
[more]Sequence* arg_viterbi
for each state, for each time step, keep the best predecessor
[more]int last_arg_viterbi
arg_viterbi of the finishing state
[more]Sequence* viterbi_sequence
for each time step, keep the best state
[more]Sequence* log_probabilities_s
keep for each time step and each model its emission log probability
[more]bool initialize
do we need to initialize the model?

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(Sequence* inputs)
computes the log_alpha during forward phase of EM
[more]virtual void logBeta(Sequence* inputs)
computes the log_beta during backward phase of EM
[more]virtual void logViterbi(Sequence* inputs)
computes the log_viterbi during forward phase of Viterbi
[more]virtual void decode(Sequence* input)
this method returns the state sequence associated to the input
[more]virtual void logProbabilities(Sequence* inputs)
computes for each state and each time step of the sequence inputs its associated emission probability


Inherited from Distribution:

Public Fields

oreal log_probability
oSequence* log_probabilities

Public Methods

ovirtual real logProbability(Sequence* inputs)
ovirtual real viterbiLogProbability(Sequence* inputs)
ovirtual real frameLogProbability(int t, real* f_inputs)
ovirtual real viterbiFrameLogProbability(int t, real* f_inputs)
ovirtual void eMIterInitialize()
ovirtual void iterInitialize()
ovirtual void eMSequenceInitialize(Sequence* inputs)
ovirtual void sequenceInitialize(Sequence* inputs)
ovirtual void eMAccPosteriors(Sequence* inputs, real log_posterior)
ovirtual void frameEMAccPosteriors(int t, real* f_inputs, real log_posterior)
ovirtual void viterbiAccPosteriors(Sequence* inputs, real log_posterior)
ovirtual void frameViterbiAccPosteriors(int t, real* f_inputs, real log_posterior)
ovirtual void eMUpdate()
ovirtual void update()
ovirtual void eMForward(Sequence* inputs)
ovirtual void viterbiForward(Sequence* inputs)
ovirtual void frameBackward(int t, real* f_inputs, real* beta_, real* f_outputs, real* alpha_)
ovirtual void viterbiBackward(Sequence* inputs, Sequence* alpha)
ovirtual void frameDecision(int t, real* decision)

Public Members

o Returns the decision of the distribution


Inherited from GradientMachine:

Public Fields

oint n_inputs
oint n_outputs
oParameters* params
oParameters* der_params
oSequence* beta

Public Methods

ovirtual void forward(Sequence* inputs)
ovirtual void backward(Sequence* inputs, Sequence* alpha)
ovirtual void setPartialBackprop(bool flag=true)
ovirtual void frameForward(int t, real* f_inputs, real* f_outputs)
ovirtual void loadXFile(XFile* file)
ovirtual void saveXFile(XFile* file)


Inherited from Machine:

Public Fields

oSequence* outputs

Public Methods

ovirtual void reset()
ovirtual void setDataSet(DataSet* dataset_)


Inherited from Object:

Public Fields

oAllocator* allocator

Public Methods

ovoid addOption(const char* name, int size, void* ptr, const char* help="")
ovoid addIOption(const char* name, int* ptr, int init_value, const char* help="")
ovoid addROption(const char* name, real* ptr, real init_value, const char* help="")
ovoid addBOption(const char* name, bool* ptr, bool init_value, const char* help="")
ovoid addOOption(const char* name, Object** ptr, Object* init_value, const char* help="")
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 setOOption(const char* name, Object* option)
ovoid load(const char* filename)
ovoid save(const char* filename)
ovoid* operator new(size_t size, Allocator* allocator_=NULL)
ovoid* operator new(size_t size, Allocator* allocator_, void* ptr_)
ovoid operator delete(void* ptr)


Documentation

This class implements a Hidden Markov Model distribution. 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.

Note that the log_probabilities is the average over all frames of the log_probability of the example.

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** shared_states
if the states are in fact shared in some way or another, the original ones are in shared_states

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

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

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

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

oint last_arg_viterbi
arg_viterbi of the finishing state

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

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

obool initialize
do we need to initialize the model?

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(Sequence* inputs)
computes the log_alpha during forward phase of EM

ovirtual void logBeta(Sequence* inputs)
computes the log_beta during backward phase of EM

ovirtual void logViterbi(Sequence* inputs)
computes the log_viterbi during forward phase of Viterbi

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

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


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

Alphabetic index HTML hierarchy of classes or Java



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