Professional Documents
Culture Documents
Asr05 HMM Algorithms
Asr05 HMM Algorithms
Peter Bell
HMM algorithms
HMM recap
HMM algorithms (2)
Likelihood computation (forward algorithm)
Finding the most probable state sequence (Viterbi algorithm)
Estimating the parameters (forward-backward and EM
algorithms)
HMM algorithms
HMM recap
HMM algorithms (2)
Likelihood computation (forward algorithm)
Finding the most probable state sequence (Viterbi algorithm)
Estimating the parameters (forward-backward and EM
algorithms)
qt-1 qt qt+1
xt-1 xt xt+1
x1 x2 x3 x4
P∗(X|M) = maxP(X,Q|M)
P∗(X|M) = maxP(X,Q|M)
P∗(X|M) = maxP(X,Q|M)
P∗(X|M) = maxP(X,Q|M)
t-1 t t+1
i i i
aij
Vi (t - 1)
max
ajj
j j j
kja
Vj (t - 1) Vj (t )
k k k
t-1 t t+1
i i i
aij
Vi (t - 1)
Bj (t ) = i
ajj
j j j
kja
Vj (t - 1) Vj (t )
k k k
Vk (t - 1)
ASR Lecture 5 HMM Algorithms 10
2. Decoding: The Viterbi algorithm
Initialisation
V0(0) = 1
Vj(0) = 0 if j =0
Bj(0) = 0
maxVi(t − 1)aijbj(xt)
i =0
maxVi(t − 1)aijbj(xt)
i =0
maxVi(t − 1)aijbj(xt)
i =0
maxVi(t − 1)aijbj(xt)
i =0
Termination
maxVT (i )aiE
i =1
s∗ maxVi(T)aiE
i =1
t-1 t t+1
Bi (t ) = j
i i
i
Vi (t - 1)
j j j
Vj (t - 1) Vj (t )
k k
Bk (t + 1) = i
k
Vk (t - 1)
ASR Lecture 5 HMM Algorithms 12
3. Training: Forward-Backward algorithm
âij = ∑ C(i→j)
k C(i→k)
âij = ∑ C(i→j)
k C(i→k)
Define indicator variable zjt = 1 if the HMM is in state j at
time t, and zjt = 0 otherwise If we knew the state-time
alignment, this variable would be observed, and we could use
it to obtain the standard maximum likelihood estimates for
the mean of the observation probability distribution:
∑
∑
t zjt
ASR Lecture 5 HMM Algorithms 14
Example
r1 r2 r3
x1 x2 x3 x4
Termination
∑
p(X | M) = β0(0) = a0j bj (x1)βj (1) = αE
j =1
∑
βj(t) = p(xt+1,...,xT |qt = j,M) = aijbj(xt+1)βj(t + 1)
j =1
t-1 t t+1
i i i
aji βi (t + 1)
∑
ajj
j j j
ajk
βj (t ) βj (t + 1)
k k k
βk (t + 1)
= p(qt=i,qt+1p(X
=j,X|M)
| M)
= αi(t)aijbj(xt+1)βj(t+1)
αE
We can use this to re-estimate the transition probabilities
∑T
t=1 ξi ,j (t)
âij = ∑J ∑T
t=1 ξi ,k (t)
k=1
See next lecture for re-estimation of obervation probabilities
bj(x)
ASR Lecture 5 HMM Algorithms 21
Pulling it all together