liggitlew
05-31-2011, 10:09 PM
I just made another post, but I think this is separate.
I would like to clarify the order for "training" the hmm.
1. First create a transition matrix (based on observation)
2. Create a symbol probability matrix (based on observation, or uniform).
3. Then, load observations.
4. Perform forwardbackward() to create a new probability state matrix.
5. Run baumwelch().
6. Repeat 3 and 6 until no more observations.
Then to use the hmm, somehow save the state probability matrix. Load it when needed, and run forwardbackward() with the new observation.
Does this make sense? It should look something like:
{
HMM newHMM(transitionMatrix, symbolProbabilityMatrix, observation[0]);
newHMM.forwardbackward();
newHMM.baumwelch();
for(int i=1; i<observation.size(); i++){
newHMM.obs = observation[i];
newHMM.forwardbackward();
newHMM.baumwelch();
}
}
//save hmm.pstate
saving and reusing the pstate matrix is a little confusing right now, but I'll come back and ask questions when I figure out what I'm asking.
Thanks!
Neal
I would like to clarify the order for "training" the hmm.
1. First create a transition matrix (based on observation)
2. Create a symbol probability matrix (based on observation, or uniform).
3. Then, load observations.
4. Perform forwardbackward() to create a new probability state matrix.
5. Run baumwelch().
6. Repeat 3 and 6 until no more observations.
Then to use the hmm, somehow save the state probability matrix. Load it when needed, and run forwardbackward() with the new observation.
Does this make sense? It should look something like:
{
HMM newHMM(transitionMatrix, symbolProbabilityMatrix, observation[0]);
newHMM.forwardbackward();
newHMM.baumwelch();
for(int i=1; i<observation.size(); i++){
newHMM.obs = observation[i];
newHMM.forwardbackward();
newHMM.baumwelch();
}
}
//save hmm.pstate
saving and reusing the pstate matrix is a little confusing right now, but I'll come back and ask questions when I figure out what I'm asking.
Thanks!
Neal