hidden markov models
play

Hidden Markov Models Aar$ Singh Slides courtesy: Eric - PowerPoint PPT Presentation

Hidden Markov Models Aar$ Singh Slides courtesy: Eric Xing Machine Learning 10-601 Nov 1, 2011 i.i.d to sequen3al data So far we


  1. Hidden ¡Markov ¡Models ¡ Aar$ ¡Singh ¡ Slides ¡courtesy: ¡Eric ¡Xing ¡ ¡ ¡ Machine ¡Learning ¡10-­‑601 ¡ Nov ¡1, ¡2011 ¡

  2. i.i.d ¡to ¡sequen3al ¡data ¡ • So ¡far ¡we ¡assumed ¡independent, ¡ iden$cally ¡distributed ¡data ¡ • Sequen$al ¡data ¡ – Time-­‑series ¡data ¡ ¡ ¡E.g. ¡Speech ¡ ¡ – Characters ¡in ¡a ¡sentence ¡ – Base ¡pairs ¡along ¡a ¡DNA ¡strand ¡

  3. Represen3ng ¡sequen3al ¡data ¡ • How ¡do ¡we ¡represent ¡and ¡learn ¡P(X 1 , ¡X 2 , ¡…, ¡X n )? ¡ X 2 ¡ X 3 ¡ X 4 ¡ X 5 ¡ X 1 ¡ • Every ¡variable ¡depends ¡on ¡past ¡few ¡variables. ¡

  4. Markov ¡Models ¡ • Joint ¡Distribu$on ¡ ¡ Chain ¡rule ¡ i ¡ i ¡ ¡ • Markov ¡Assump$on ¡(m th ¡order) ¡ Current observation only depends on past i ¡ i ¡ m observations n • Special ¡case ¡of ¡Bayes ¡Nets ¡ Y p ( X ) = p ( X i | pa ( X i )) i =1

  5. Markov ¡Models ¡ • Markov ¡Assump$on ¡ ¡ ¡1 st ¡order ¡ ¡ ¡ ¡ ¡2 nd ¡order ¡

  6. Markov ¡Models ¡ # parameters in stationary model • Markov ¡Assump$on ¡ ¡ K-ary variables ¡1 st ¡order ¡ O(K 2 ) ¡ ¡m th ¡order ¡ O(K m+1 ) ¡ ¡n-­‑1 th ¡order ¡ O(K n ) ¡≡ ¡no ¡assump$ons ¡– ¡complete ¡(but ¡directed) ¡graph ¡ Homogeneous/stationary Markov model (probabilities don’t depend on n) ¡

  7. Hidden ¡Markov ¡Models ¡ • Distribu$ons ¡that ¡characterize ¡sequen$al ¡data ¡with ¡few ¡ parameters ¡but ¡are ¡not ¡limited ¡by ¡strong ¡Markov ¡assump$ons. ¡ S 1 ¡ S 2 ¡ S T-­‑1 ¡ S T ¡ O 2 ¡ O T-­‑1 ¡ O T ¡ O 1 ¡ ¡ ¡ ¡ ¡ Observa$on ¡space ¡ ¡ ¡O t ¡ϵ ¡{y 1 , ¡y 2 , ¡…, ¡y K } ¡e.g. ¡pixels ¡in ¡ ¡Hidden ¡states ¡ ¡ ¡S t ¡ϵ ¡{1, ¡…, ¡ I } ¡ ¡e.g. ¡{a,b,c,…z} ¡ ¡ ¡

  8. Hidden ¡Markov ¡Models ¡ S 1 ¡ S 2 ¡ S T-­‑1 ¡ S T ¡ O 2 ¡ O T-­‑1 ¡ O T ¡ O 1 ¡ 1 st ¡order ¡Markov ¡assump$on ¡on ¡hidden ¡states ¡ ¡{S t } ¡ ¡t ¡= ¡1, ¡…, ¡T ¡ (can ¡be ¡extended ¡to ¡higher ¡order). ¡ ¡ Note: ¡O t ¡depends ¡on ¡all ¡previous ¡observa$ons ¡{O t-­‑1 ,…O 1 } ¡

  9. HMM ¡Example ¡ • The ¡Dishonest ¡Casino ¡ A ¡casino ¡has ¡two ¡die: ¡ Fair ¡dice ¡ ¡ Loaded ¡dice ¡ ¡ ¡ Casino ¡player ¡switches ¡back-­‑&-­‑ forth ¡between ¡fair ¡and ¡loaded ¡die ¡

  10. HMM ¡Example ¡ L ¡ F ¡ F ¡ F ¡ L ¡ L ¡ L ¡ F ¡

  11. Hidden ¡Markov ¡Models ¡ • Parameters ¡– ¡ sta$onary/homogeneous ¡markov ¡model ¡ (independent ¡of ¡$me ¡t) ¡ S 1 ¡ S 2 ¡ S T-­‑1 ¡ S T ¡ ¡Ini$al ¡probabili$es ¡ ¡ ¡p(S 1 ¡= ¡i) ¡= ¡π i ¡ O 1 ¡ O 2 ¡ O T-­‑1 ¡ O T ¡ ¡ ¡Transi$on ¡probabili$es ¡ ¡ ¡p(S t ¡= ¡j|S t-­‑1 ¡= ¡i) ¡= ¡p ij ¡ ¡ ¡Emission ¡probabili$es ¡ ¡ ¡p(O t ¡ = ¡y|S t = ¡i) ¡= ¡ ¡

  12. HMM ¡Example ¡ • The ¡Dishonest ¡Casino ¡ A ¡casino ¡has ¡two ¡die: ¡ Fair ¡dice ¡ P(1) ¡= ¡P(2) ¡= ¡P(3) ¡= ¡P(5) ¡= ¡P(6) ¡= ¡1/6 ¡ Loaded ¡dice ¡ P(1) ¡= ¡P(2) ¡= ¡P(3) ¡= ¡P(5) ¡= ¡1/10 ¡ P(6) ¡= ¡½ ¡ ¡ Casino ¡player ¡switches ¡back-­‑&-­‑ forth ¡between ¡fair ¡and ¡loaded ¡die ¡ once ¡every ¡20 ¡turns ¡

  13. State ¡Space ¡Representa3on ¡ • Switch ¡between ¡ F ¡and ¡ L ¡once ¡every ¡20 ¡turns ¡(1/20 ¡= ¡0.05) ¡ 0.05 ¡ 0.95 ¡ 0.95 ¡ L ¡ F ¡ 0.05 ¡ • HMM ¡Parameters ¡ ¡Ini$al ¡probs ¡ ¡ ¡ ¡ ¡P(S 1 ¡ = ¡ L ) ¡= ¡0.5 ¡= ¡P(S 1 ¡= ¡ F ) ¡ ¡ ¡Transi$on ¡probs ¡ ¡P(S t ¡= ¡ L / F |S t-­‑1 ¡= ¡ L / F ) ¡= ¡0.95 ¡ ¡ ¡ ¡ ¡P(S t ¡= ¡ F / L |S t-­‑1 ¡= ¡ L / F ) ¡= ¡0.05 ¡ ¡ ¡ ¡ ¡ ¡Emission ¡probabili$es ¡ ¡ ¡P(O t ¡ = ¡y|S t = ¡ F ) ¡= ¡1/6 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡y ¡= ¡1,2,3,4,5,6 ¡ ¡ ¡ ¡ ¡ ¡P(O t ¡ = ¡y|S t = ¡ L ) ¡= ¡1/10 ¡ ¡ ¡ ¡ ¡ ¡y ¡= ¡1,2,3,4,5 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡= ¡1/2 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡y ¡= ¡6 ¡ ¡

  14. HMM ¡Problems ¡

  15. Three ¡main ¡problems ¡in ¡HMMs ¡ • Evalua$on ¡– ¡ Given ¡HMM ¡parameters ¡& ¡observa$on ¡seqn ¡ ¡ ¡find ¡ ¡ ¡ ¡ ¡ ¡ ¡prob ¡of ¡observed ¡sequence ¡ • Decoding ¡– ¡ Given ¡HMM ¡parameters ¡& ¡observa$on ¡seqn ¡ ¡ ¡find ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡most ¡probable ¡ ¡sequence ¡of ¡hidden ¡states ¡ • Learning ¡– ¡ Given ¡HMM ¡with ¡unknown ¡parameters ¡and ¡ ¡ ¡ ¡observa$on ¡sequence ¡ ¡ ¡find ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡parameters ¡that ¡maximize ¡ ¡likelihood ¡of ¡observed ¡data ¡

  16. HMM ¡Algorithms ¡ • Evalua$on ¡– ¡ What ¡is ¡the ¡probability ¡of ¡the ¡observed ¡ sequence? ¡Forward ¡Algorithm ¡ • Decoding ¡– ¡ What ¡is ¡the ¡probability ¡that ¡the ¡third ¡roll ¡was ¡ loaded ¡given ¡the ¡observed ¡sequence? ¡Forward-­‑Backward ¡ Algorithm ¡ ¡– ¡What ¡is ¡the ¡most ¡likely ¡die ¡sequence ¡given ¡the ¡observed ¡ sequence? ¡Viterbi ¡Algorithm ¡ ¡ • Learning ¡– ¡ Under ¡what ¡parameteriza$on ¡is ¡the ¡observed ¡ sequence ¡most ¡probable? ¡Baum-­‑Welch ¡Algorithm ¡(EM) ¡

  17. Evalua3on ¡Problem ¡ • Given ¡HMM ¡parameters ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡& ¡observa$on ¡ sequence ¡ S T-­‑1 ¡ S 1 ¡ S 2 ¡ S T ¡ ¡find ¡probability ¡of ¡observed ¡sequence ¡ O T-­‑1 ¡ O T ¡ O 1 ¡ O 2 ¡ ¡ ¡ ¡ ¡ ¡requires ¡summing ¡over ¡all ¡possible ¡hidden ¡state ¡values ¡at ¡all ¡ $mes ¡– ¡K T ¡exponen$al ¡# ¡terms! ¡ ¡Instead: ¡ k ¡ Compute recursively α T ¡

  18. Forward ¡Probability ¡ ¡ k ¡ Compute ¡forward ¡probability ¡ ¡ ¡ ¡ ¡ ¡ ¡recursively ¡over ¡t ¡ ¡ α t ¡ S t-­‑1 ¡ S t ¡ S 1 ¡ O t-­‑1 ¡ O t ¡ O 1 ¡ Introduce ¡S t-­‑1 ¡ . ¡ Chain ¡rule ¡ . ¡ . ¡ Markov ¡assump$on ¡

  19. Forward ¡Algorithm ¡ Can ¡compute ¡α t k ¡ ¡for ¡all ¡k, ¡t ¡using ¡dynamic ¡programming: ¡ ¡ • Ini$alize: ¡ ¡α 1 k ¡= ¡p(O 1 |S 1 ¡= ¡k) ¡p(S 1 ¡= ¡k) ¡ ¡for ¡all ¡k ¡ • Iterate: ¡for ¡t ¡= ¡2, ¡…, ¡T ¡ i ¡ ¡ ¡ ¡α t k ¡= ¡p(O t |S t ¡= ¡k) ¡∑ ¡α t-­‑1 ¡ p(S t ¡= ¡k|S t-­‑1 ¡= ¡i) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡for ¡all ¡k ¡ i ¡ k ¡ • Termina$on: ¡ ¡ ¡ ¡ ¡ ¡= ¡∑ ¡α T ¡ k ¡

  20. Decoding ¡Problem ¡1 ¡ • Given ¡HMM ¡parameters ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡& ¡observa$on ¡ sequence ¡ ¡find ¡probability ¡that ¡hidden ¡state ¡at ¡$me ¡t ¡was ¡k ¡ ¡ ¡ ¡ ¡ k ¡ k ¡ Compute recursively β t ¡ α t ¡ S t-­‑1 ¡ S t ¡ S t+1 ¡ S 1 ¡ S T-­‑1 ¡ S T ¡ O t-­‑1 ¡ O t ¡ O t+1 ¡ O 1 ¡ O T-­‑1 ¡ O T ¡

  21. Backward ¡Probability ¡ ¡ k ¡ Compute ¡backward ¡probability ¡ ¡ ¡ ¡ ¡ ¡ ¡recursively ¡over ¡t ¡ ¡ β t ¡ S t ¡ S t+1 ¡ S T-­‑1 ¡ S T ¡ O t+1 ¡ O T-­‑1 ¡ O T ¡ Introduce ¡S t+1 ¡ . ¡ Chain ¡rule ¡ . ¡ . ¡ Markov ¡assump$on ¡

  22. Backward ¡Algorithm ¡ Can ¡compute ¡β t k ¡ ¡for ¡all ¡k, ¡t ¡using ¡dynamic ¡programming: ¡ ¡ • Ini$alize: ¡ ¡β T k ¡= ¡1 ¡ ¡for ¡all ¡k ¡ • Iterate: ¡for ¡t ¡= ¡T-­‑1, ¡…, ¡1 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡for ¡all ¡k ¡ • Termina$on: ¡ ¡ ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend