toy baum welch - Pastebin.com
hidden-markov-modelsforward-backwardbaum-welchpythonnlp
Abstraction: Python implementation of forward-backward algorithm and Baum-Welch EM for HMMs
Key points:
- Implements forward (alpha) and backward (beta) passes for hidden Markov models in Python
- Follows Jason Eisner's spreadsheet-based teaching tool (JHU, 2002)
- Re-estimates transition, emission, initial, and final probability matrices via EM
- Convergence checked by likelihood ratio threshold (default 4e-20); stops early when ratio met
- Uses JSON files for all probability matrix inputs; observations passed as space-separated string
- Also implements Viterbi best-path decoding over the forward lattice
Connections: Hidden Markov Models ยท Expectation Maximization
Source: http://pastebin.com/aJG3Ukmn