|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ocvolume.hmm.markov
last updated on June 15, 2002
description: this class represents a left-to-right Hidden Markov Model and its essential methods for speech recognition.
The collection of methods include Forward-Backward Algorithm, Baum-Welch Algorithm, Scaling, Viterbi, etc.
calls: none
called by: volume, train
input: sequence of integers
output: probability
Field Summary | |
protected double[][] |
alpha
forward variable alpha |
protected double[][] |
beta
backward variable beta |
protected int[] |
currentSeq
current observation sequence |
protected int |
delta
number of states the model is allowed to jump |
protected int |
len_obSeq
length of observation sequence |
protected int |
num_obSeq
number of observation sequence |
protected int |
num_states
number of state in the model example: number of urns |
protected int |
num_symbols
number of observation symbols per state example: how many different colour balls there are |
protected int[][] |
obSeq
discrete set of observation symbols example: sequence of colour of balls |
protected double[][] |
output
discrete output probability example: probability of a specific output from a state |
protected double[] |
pi
initial state distribution example: which state is the starting state |
int[] |
q
best state sequence |
protected double[] |
scaleFactor
Scale Coefficient |
protected double[][] |
transition
state transition probability example: probability from one state to another state |
Constructor Summary | |
markov(int num_states,
int num_symbols)
class constructor - used to create a left-to-right model with multiple observation sequences for training calls: none called by: trainHMM |
|
markov(java.lang.String filepath)
class constructor - used to create a model from a saved file calls: none called by: volume, trainHMM |
Method Summary | |
protected double |
computeAlpha()
calculate forward variable alpha calls: none called by: markov |
protected void |
computeBeta()
calculate backward variable beta for later use with Re-Estimation method calls: none called by: markov |
double |
getProbability(int[] testSeq)
returns the probability calculated from the testing sequence calls: none called by: volume |
void |
save(java.lang.String filepath)
save HMM model to file calls: none called by: trainHMM |
void |
setNumObSeq(int k)
set the number of training sequences calls: none called by: trainHMM |
void |
setObSeq(int[] observationSeq)
set observation sequence calls: none called by: trainHMM |
void |
setTrainSeq(int[][] trainSeq)
set training sequences for re-estimation step calls: none called by: trainHMM |
void |
setTrainSeq(int k,
int[] trainSeq)
set a training sequence for re-estimation step calls: none called by: trainHMM |
void |
train()
train the hmm model until no more improvement calls: none called by: trainHMM |
double |
viterbi(int[] testSeq)
viterbi algorithm used to get best state sequence and probability calls: none called by: volume |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int len_obSeq
protected int num_states
protected int num_symbols
protected final int delta
protected int[][] obSeq
protected int[] currentSeq
protected int num_obSeq
protected double[][] transition
protected double[][] output
protected double[] pi
protected double[][] alpha
protected double[][] beta
protected double[] scaleFactor
public int[] q
Constructor Detail |
public markov(java.lang.String filepath)
filepath
- path of the file to loadpublic markov(int num_states, int num_symbols)
num_states
- number of states in the modelnum_symbols
- number of symbols per stateMethod Detail |
public double viterbi(int[] testSeq)
testSeq
- test sequence
public double getProbability(int[] testSeq)
testSeq
- testing sequence
protected double computeAlpha()
protected void computeBeta()
public void setNumObSeq(int k)
k
- number of training sequencespublic void setTrainSeq(int k, int[] trainSeq)
k
- index representing kth training sequencetrainSeq
- training sequencepublic void setTrainSeq(int[][] trainSeq)
trainSeq
- training sequencespublic void train()
public void setObSeq(int[] observationSeq)
observationSeq
- observation sequencepublic void save(java.lang.String filepath)
filepath
- file location
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |