Professional Documents
Culture Documents
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Extensions
Marcin Marszalek
Visual Geometry Group
16 February 2009
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Extensions
Markov processes
Hidden Markov processes
A Tutorial on Hidden Markov Models
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Extensions
Markov processes
Hidden Markov processes
A Tutorial on Hidden Markov Models
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
N states: S1 , S2 , ..., SN
In each time instant t = 1, 2, ..., T a system changes
(makes a transition) to state qt
Marcin Marszalek
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Extensions
N
X
1 i, j N
aij = 1
j=1
Marcin Marszalek
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
= {i }
i = P(q1 = Si )
1 i, j N
1i N
1k M
1i N
Marcin Marszalek
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Extensions
Marcin Marszalek
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
T
Y
t=1
P(Ot |qt , ) =
T
Y
bqt Ot
t=1
T
Y
t=2
Marcin Marszalek
P(qt |qt1 ) = q1
T
Y
aqt1 qt
t=2
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
T
Y
aqt1 qt
t=2
T
Y
t=1
q1 bq1 O1
T
Y
aqt1 qt bqt Ot
t=2
Marcin Marszalek
bqt Ot
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Forward procedure
We define a forward variable j (t) as the probability of the
partial observation seq. until time t, with state Sj at time t
j (t) = P(O1 O2 ...Ot , qt = Sj |)
This can be computed inductively
1j N
j (1) = j bjO1
j (t + 1) =
N
X
i (t)aij bjOt+1
1t T 1
i=1
N
X
P(O, qT = Si |) =
i=1
Marcin Marszalek
N
X
i (T )
i=1
A Tutorial on Hidden Markov Models
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Forward procedure
Figure: Operations for
computing the forward
variable j (t + 1)
Marcin Marszalek
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Backward procedure
Figure: Operations for
computing the backward
variable i (t)
We define a backward
variable i (t) as the
probability of the partial
observation seq. after time t, given state Si at time t
i (t) = P(Ot+1 Ot + 2...OT |qt = Si , )
This can be computed inductively as well
1i N
i (T ) = 1
i (t 1) =
N
X
2tT
j=1
Marcin Marszalek
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Extensions
The first choice means finding argmaxi i (t) for each t, where
i (t) = P(qt = Si |O, )
In terms of forward and backward variables
P(O1 ...Ot , qt = Si |)P(Ot+1 ...OT |qt = Si , )
P(O|)
i (t)i (t)
i (t) = PN
j=1 j (t)j (t)
i (t) =
Marcin Marszalek
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Extensions
Viterbi algorithm
Finding the best single sequence means computing
argmaxQ P(Q|O, ), equivalent to argmaxQ P(Q, O|)
The Viterbi algorithm (dynamic programming) defines j (t),
i.e., the highest probability of a single path of length t which
accounts for the observations and ends in state Sj
j (t) =
max
q1 ,q2 ,...,qt1
By induction
1j N
j (1) = j bjO1
1t T 1
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Backtracking
c G.W. Pulford
Figure: Illustration of the backtracking procedure
Marcin Marszalek
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
N
X
ij (t)
j=1
(t)
= expected number of transitions from Si to Sj
ij
t=1
t=1
Marcin Marszalek
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Extensions
Baum-Welch Reestimation
Reestimation formulas
PT 1
i = i (1)
aij =
t=1 ij (t)
PT 1
t=1 i (t)
O =v j (t)
bjk = PTt k
t=1 j (t)
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
Non-ergodic HMMs
Until now we have only considered
ergodic (fully connected) HMMs
every state can be reached from
any state in a finite number of
steps
Figure: Ergodic HMM
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
M
X
m=1
Marcin Marszalek
Extensions
Introduction
Forward-Backward Procedure
Viterbi Algorithm
Baum-Welch Reestimation
More fun
Autoregressive HMMs
State Duration Density HMMs
Discriminatively trained HMMs
maximum mutual information
instead of maximum likelihood
Extensions