HMM< T > Class Template Reference

Collaboration diagram for HMM< T >:
Collaboration graph
[legend]

List of all members.

Classes

struct  Path
struct  SeqInfo

Public Member Functions

 HMM (const std::vector< T > &states, const std::vector< T > &observations, const std::string &name="")
 ~HMM ()
 Destructor.
void setStateTransition (const T fromState, const T toState, double prob)
 Set the state transitions.
void setStateEmission (const T state, const T emission, double prob)
 The state emission probability.
void setCurrentState (const T state, double prob)
 Set the current prob of which state we are in.
std::vector< T > getLikelyStates (const std::vector< T > observations, double &maxPathProb=double())
void iteratePath (const T observation)
 Iterate through the path given one observation.
double forward (const std::vector< T > observations)
 Forward alg ie. compute P(Obj | currentHMMModel).
double backward (const std::vector< T > observations)
 Backward alg.
void train (const std::vector< std::vector< T > > observations, size_t numIterations)
void train (const std::vector< T > observations, size_t numIterations)
void computeXi (const std::vector< T > observations)
void computeGamma (const std::vector< T > observations)
std::vector< T > getMaxPath (double &maxPathProb)
 Get the max path so far.
void show ()
 Show the internal states and observations of the HMM.
std::string getName ()
 Get the hmm name.

Detailed Description

template<class T>
class HMM< T >

Definition at line 51 of file HMM.H.


Constructor & Destructor Documentation

template<class T >
HMM< T >::~HMM (  )  [inline]

Destructor.

Definition at line 74 of file HMM.C.


Member Function Documentation

template<class T>
double HMM< T >::backward ( const std::vector< T >  observations  )  [inline]

Backward alg.

Definition at line 299 of file HMM.C.

References Image< T >::getVal(), and sum().

Referenced by HMM< T >::train().

template<class T>
double HMM< T >::forward ( const std::vector< T >  observations  )  [inline]

Forward alg ie. compute P(Obj | currentHMMModel).

Definition at line 237 of file HMM.C.

References Image< T >::getVal(), log(), and sum().

Referenced by HMM< T >::train().

template<class T>
std::vector< T > HMM< T >::getLikelyStates ( const std::vector< T >  observations,
double &  maxPathProb = double() 
) [inline]

Find the most likely sequence of hidden states given the observations and return the probability of this path.

Definition at line 162 of file HMM.C.

References HMM< T >::getMaxPath(), and HMM< T >::iteratePath().

template<class T >
std::vector< T > HMM< T >::getMaxPath ( double &  maxPathProb  )  [inline]

Get the max path so far.

Definition at line 178 of file HMM.C.

Referenced by HMM< T >::getLikelyStates().

template<class T>
std::string HMM< T >::getName ( void   )  [inline]

Get the hmm name.

Definition at line 133 of file HMM.H.

template<class T>
void HMM< T >::iteratePath ( const T  observation  )  [inline]

Iterate through the path given one observation.

Definition at line 201 of file HMM.C.

References Image< T >::getVal().

Referenced by HMM< T >::getLikelyStates().

template<class T>
void HMM< T >::setCurrentState ( const T  state,
double  prob 
) [inline]

Set the current prob of which state we are in.

Definition at line 103 of file HMM.C.

template<class T>
void HMM< T >::setStateEmission ( const T  state,
const T  emission,
double  prob 
) [inline]

The state emission probability.

Definition at line 92 of file HMM.C.

References Image< T >::setVal().

template<class T>
void HMM< T >::setStateTransition ( const T  fromState,
const T  toState,
double  prob 
) [inline]

Set the state transitions.

Definition at line 81 of file HMM.C.

References Image< T >::setVal().

template<class T >
void HMM< T >::show (  )  [inline]

Show the internal states and observations of the HMM.

Definition at line 114 of file HMM.C.

References Image< T >::getHeight(), Image< T >::getVal(), and Image< T >::getWidth().

template<class T>
void HMM< T >::train ( const std::vector< T >  observations,
size_t  numIterations 
) [inline]

Train the model by changing the state transitions and state emittions for the given observation batch update per Fundamentals of Speech Recognition - by Lawrence Rabiner , Biing-Hwang Juang

Definition at line 336 of file HMM.C.

References HMM< T >::backward(), HMM< T >::forward(), and Image< T >::setVal().

template<class T>
void HMM< T >::train ( const std::vector< std::vector< T > >  observations,
size_t  numIterations 
) [inline]

Train the model by changing the state transitions and state emittions for the given observation

Definition at line 421 of file HMM.C.

References HMM< T >::backward(), exp(), HMM< T >::forward(), gamma(), and Image< T >::setVal().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:21 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3