ToPS
|
Interface defining probabilistic model with the viterbi, forward and backward algorithm. More...
#include <DecodableModel.hpp>
Public Member Functions | |
virtual double | evaluate (const Sequence &s, unsigned int begin, unsigned int end) const |
Calculates the sequence likelihood given this model. | |
virtual double | forward (const Sequence &s, Matrix &alpha) const =0 |
Forward algorithm. | |
virtual double | backward (const Sequence &s, Matrix &beta) const =0 |
Backward algorithm. | |
virtual double | viterbi (const Sequence &s, Sequence &path, Matrix &gamma) const =0 |
Viterbi algorithm. | |
virtual void | choosePath (const Sequence &s, Sequence &path) |
Choose a path given a sequence. | |
virtual void | posteriorProbabilities (const Sequence &s, Matrix &probabilities) const |
Posterior Probabilities: P(yi=k|x) | |
virtual void | posteriorProbabilities (const Sequence &s, SparseMatrixPtr probabilities) const |
Posterior Probabilities: P(yi=k|x) | |
virtual void | posteriorDecoding (const Sequence &s, Sequence &path, Matrix &probabilities) const |
Posterior Decoding: ^yi = argmax_k P(yi=k|x) | |
virtual Sequence & | chooseObservation (Sequence &h, int i, int state) const =0 |
Choose the observation given a state. | |
virtual int | chooseState (int state) const =0 |
Choose a state. | |
virtual int | chooseFirstState () const =0 |
Choose the initial state. | |
virtual std::string | getStateName (int state) const =0 |
Get state name. | |
virtual AlphabetPtr | getStateNames () const =0 |
Get the state names. |
Interface defining probabilistic model with the viterbi, forward and backward algorithm.
Definition at line 38 of file DecodableModel.hpp.
virtual Sequence& tops::DecodableModel::chooseObservation | ( | Sequence & | h, |
int | i, | ||
int | state | ||
) | const [pure virtual] |
Choose the observation given a state.
h | is the history |
Implemented in tops::GeneralizedHiddenMarkovModel, and tops::HiddenMarkovModel.