|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wiigee.logic.HMM
public class HMM
This is a Hidden Markov Model implementation which internally provides the basic algorithms for training and recognition (forward and backward algorithm). Since a regular Hidden Markov Model doesn't provide a possibility to train multiple sequences, this implementation has been optimized for this purposes using some state-of-the-art technologies described in several papers.
| Field Summary | |
|---|---|
protected double[][] |
a
The state change probability to switch from state A to state B: a[stateA][stateB] |
protected double[][] |
b
The probability to emit symbol S in state A: b[stateA][symbolS] |
protected int |
numObservations
The number of observations |
protected int |
numStates
The number of states |
protected double[] |
pi
The initial probabilities for each state: p[state] |
| Constructor Summary | |
|---|---|
HMM(int numStates,
int numObservations)
Initialize the Hidden Markov Model in a left-to-right version. |
|
| Method Summary | |
|---|---|
protected double[][] |
backwardProc(int[] o)
Backward algorithm. |
protected double[][] |
forwardProc(int[] o)
Traditional Forward Algorithm. |
double[][] |
getA()
|
double[][] |
getB()
|
double[] |
getPi()
|
double |
getProbability(int[] o)
Returns the probability that a observation sequence O belongs to this Hidden Markov Model without using the bayes classifier. |
void |
print()
Prints everything about this model, including all values. |
void |
setA(double[][] a)
|
void |
setB(double[][] b)
|
void |
setPi(double[] pi)
|
void |
train(java.util.Vector<int[]> trainsequence)
Trains the Hidden Markov Model with multiple sequences. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int numStates
protected int numObservations
protected double[] pi
protected double[][] a
protected double[][] b
| Constructor Detail |
|---|
public HMM(int numStates,
int numObservations)
numStates - Number of statesnumObservations - Number of observations| Method Detail |
|---|
public void train(java.util.Vector<int[]> trainsequence)
protected double[][] forwardProc(int[] o)
o - the observationsequence O
public double getProbability(int[] o)
o - observation sequence
protected double[][] backwardProc(int[] o)
o - observation sequence o
public void print()
public double[] getPi()
public void setPi(double[] pi)
public double[][] getA()
public void setA(double[][] a)
public double[][] getB()
public void setB(double[][] b)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||