Title: Trellis Algorithms
1Trellis Algorithms
2Trellis Algorithms
- Overlap in paths implies repetition of the same
calculations - Harness the overlap to make calculations
efficient - A node at (si , t) stores info about state
sequences that contain Xt si - This is the basis of dynamic programming
3Viterbi Algorithm
- A node at (si , t) stores info about state
sequences up to time t that arrive at si
s1
sj
Choose max path
s2
4Viterbi Algorithm
is the best score along a single path, at
time t, which accounts for the first t
observations and ends in state si
By induction we have
Efficiently implemented using a trellis structure
5Viterbi Algorithm
6Viterbi Algorithm
7Implementation
function VITERBI(observations, a, b) returns
viterbi-probability num-states ?
NUM-OF-STATES(pi) num-obs ?
LENGTH(observations) Create and initialise
probability matrix viterbinum-states1,
num-obs1 viterbi0, 0 ? 1.0 for each
time t from 1 to num-obs for each state s
from 1 to num-states max ? 0
for each previous state p from 0 to
num-states max ? MAX(max,
viterbip, t-1 ap, s bs,
observationst) end
viterbis, t ? max end end max
? 0 for each previous state p from 0 to
num-states max ? MAX(max, viterbip,
num-obs ap, FINAL-STATE) end return
max