SlideShare a Scribd company logo
CS 221: Artificial Intelligence Lecture 5: Hidden Markov Models and Temporal Filtering Sebastian Thrun and Peter Norvig Slide credit: Dan Klein, Michael Pfeiffer
Class-On-A-Slide X 5 X 2 E 1 X 1 X 3 X 4 E 2 E 3 E 4 E 5
Example: Minerva
Example: Robot Localization
Example: Groundhog
Example: Groundhog
Example: Groundhog
CS221: HMM and Particle Filters
Overview Markov Chains Hidden Markov Models Particle Filters More on HMMs
Reasoning over Time Often, we want to  reason about a sequence  of observations Speech recognition Robot localization User attention Medical monitoring Financial modeling
Markov Models A  Markov model  is a chain-structured BN Each node is identically distributed (stationarity) Value of X at a given time is called the  state As a BN: Parameters: called  transition probabilities  or dynamics, specify how the state evolves over time (also, initial probs) X 2 X 1 X 3 X 4
Conditional Independence Basic conditional independence: Past and future independent of the present Each time step only depends on the previous This is called the Markov property Note that the chain is just a (growing) BN We can always use generic BN reasoning on it if we truncate the chain at a fixed length X 2 X 1 X 3 X 4
Example: Markov Chain Weather: States: X = {rain, sun} Transitions: Initial distribution: 1.0 sun What ’s the probability distribution after one step? rain sun 0.9 0.9 0.1 0.1 This is a CPT, not a BN!
Mini-Forward Algorithm Question: What ’s P(X) on some day t? An instance of variable elimination! sun rain sun rain sun rain sun rain Forward simulation
Example From initial observation of sun From initial observation of rain P( X 1 ) P( X 2 ) P( X 3 ) P( X  ) P( X 1 ) P( X 2 ) P( X 3 ) P( X  )
Stationary Distributions If we simulate the chain long enough: What happens? Uncertainty accumulates Eventually, we have no idea what the state is! Stationary distributions: For most chains, the distribution we end up in is independent of the initial distribution Called the  stationary distribution  of the chain Usually, can only predict a short time out
Example: Web Link Analysis PageRank over a web graph Each web page is a state Initial distribution: uniform over pages Transitions: With prob. c, uniform jump to a random page (dotted lines, not all shown) With prob. 1-c, follow a random outlink (solid lines) Stationary distribution Will spend more time on highly reachable pages Google 1.0 returned the set of pages containing all your keywords in decreasing rank, now all search engines use link analysis along with many other factors (rank actually getting less important over time)
Overview Markov Chains Hidden Markov Models Particle Filters More on HMMs
Hidden Markov Models Markov chains not so useful for most agents Eventually you don’t know anything anymore Need observations to update your beliefs Hidden Markov models (HMMs) Underlying Markov chain over states S You observe outputs (effects) at each time step As a Bayes net: X 5 X 2 E 1 X 1 X 3 X 4 E 2 E 3 E 4 E 5
Example: Robot Localization t=0 Sensor model: never more than 1 mistake Motion model: may not execute action with small prob. 1 0 Prob Example from  Michael Pfeiffer
Example: Robot Localization t=1 1 0 Prob
Example: Robot Localization t=2 1 0 Prob
Example: Robot Localization t=3 1 0 Prob
Example: Robot Localization t=4 1 0 Prob
Example: Robot Localization t=5 1 0 Prob
Hidden Markov Model HMMs have two important independence properties: Markov hidden process, future depends on past via the present Current observation independent of all else given current state Quiz: does this mean that observations are mutually independent? [No, correlated by the hidden state] X 5 X 2 E 1 X 1 X 3 X 4 E 2 E 3 E 4 E 5
Inference in HMMs (Filtering) E 1 X 1 X 2 X 1
Example An HMM is defined by: Initial distribution: Transitions: Emissions:
Example HMM
Example: HMMs in Robotics
Overview Markov Chains Hidden Markov Models Particle Filters More on HMMs
Example: Robot Localization
Particle Filtering Sometimes |X| is too big to use exact inference |X| may be too big to even store B(X) E.g. X is continuous |X| 2  may be too big to do updates Solution: approximate inference Track samples of X, not all values Samples are called particles Time per step is linear in the number of samples But: number needed may be large In memory: list of particles, not states This is how robot localization works in practice 0.0 0.1 0.0 0.0 0.0 0.2 0.0 0.2 0.5
Representation: Particles Our representation of P(X) is now a list of N particles (samples) Generally, N << |X| Storing map from X to counts would defeat the point P(x) approximated by number of particles with value x So, many x will have P(x) = 0!  More particles, more accuracy For now, all particles have a weight of 1 Particles: (3,3) (2,3) (3,3)  (3,2) (3,3) (3,2) (2,1) (3,3) (3,3) (2,1)
Particle Filtering: Elapse Time Each particle is moved by sampling its next position from the transition model This is like prior sampling – samples ’ frequencies reflect the transition probs Here, most samples move clockwise, but some move in another direction or stay in place This captures the passage of time If we have enough samples, close to the exact values before and after (consistent)
Particle Filtering: Observe Slightly trickier: Don ’t do rejection sampling (why not?) We don ’t sample the observation, we fix it This is similar to likelihood weighting, so we downweight our samples based on the evidence Note that, as before, the probabilities don ’t sum to one, since most have been downweighted (in fact they sum to an approximation of P(e))
Particle Filtering: Resample Rather than tracking weighted samples, we resample N times, we choose from our weighted sample distribution (i.e. draw with replacement) This is analogous to renormalizing the distribution Now the update is complete for this time step, continue with the next one Old Particles: (3,3) w=0.1 (2,1) w=0.9 (2,1) w=0.9  (3,1) w=0.4 (3,2) w=0.3 (2,2) w=0.4 (1,1) w=0.4 (3,1) w=0.4 (2,1) w=0.9 (3,2) w=0.3 New Particles: (2,1) w=1 (2,1) w=1 (2,1) w=1  (3,2) w=1 (2,2) w=1 (2,1) w=1 (1,1) w=1 (3,1) w=1 (2,1) w=1 (1,1) w=1
Particle Filters
Sensor Information: Importance Sampling
Robot Motion
Sensor Information: Importance Sampling
Robot Motion
Particle Filter Algorithm Sample the next generation for particles using the proposal distribution Compute the importance weights : weight = target distribution / proposal distribution Resampling:  “Replace unlikely samples by more likely ones”
Particle Filter Algorithm Algorithm  particle_filter (  S t-1 , u t-1  z t ): For  Generate new samples Sample index  j(i)  from the discrete distribution given by  w t-1 Sample  from  using  and Compute importance weight Update normalization factor Insert For   Normalize weights
Overview Markov Chains Hidden Markov Models Particle Filters More on HMMs
Other uses of HMM Find most likely sequence of states Viterbi algorithm Learn HMM parameters from data Baum-Welch (EM) algorithm Other types of HMMs Continuous, Gaussian-linear: Kalman filter Structured transition/emission probabilities: Dynamic Bayes network (DBN)
Real HMM Examples Speech recognition HMMs: Observations are acoustic signals (continuous valued) States are specific positions in specific words (so, tens of thousands) Machine translation HMMs: Observations are words (tens of thousands) States are translation options (dozens per word) Robot tracking: Observations are range readings (continuous) States are positions on a map (continuous)
HMM Application Domain: Speech Speech input is an acoustic wave form s  p  ee  ch  l  a  b Graphs from Simon Arnfield ’s web tutorial on speech, Sheffield: http://www.psyc.leeds.ac.uk/research/cogn/speech/tutorial/ “ l” to “a” transition:
Time for Questions
Learning Problem Given example observation trajectories umbrella, umbrella, no-umbrella, umbrella no-umbrella, no-umbrella, no-umbrella  … Given: structure of HMM Problem: Learn probabilities P(x), P(x’|x), P(z|x)
Learning: Basic Idea Initialize P(x), P(x’|x), P(z|x) randomly Calculate for each sequence z 1 ..z K P(x 1  | z 1 ..z K ), P(x 2  | z 1 ..z K ), …, P(x N  | z 1 ..z K ) Those are known as “expectations” Now, compute P(x), P(x’|x), P(z|x) to best match those internal expectations Iterate
Let’s first learn a Markov Chain 3 Episodes (R=rain, S=sun) S, R, R, S, S, S, S, S, S, S R, S, S, S, S, R, R, R, R, R S, S, S, R, R, S, S, S, S, S Initial probability P(S) = 2/3 State transition probability P(S’|S) = 5/6 P(R’|R) = 2/3

More Related Content

PDF
Introduction to Data Assimilation
PPTX
Computer Vision Structure from motion
PDF
Lecture 9 Markov decision process
PPTX
Electromagnetic waves
PPT
LORENTZ TRANSFORMATION Pooja chouhan
PDF
Lecture 4 Relationship between pixels
PPT
lecture27 on phase change due to ref.ppt
PDF
Bilateral filtering for gray and color images
Introduction to Data Assimilation
Computer Vision Structure from motion
Lecture 9 Markov decision process
Electromagnetic waves
LORENTZ TRANSFORMATION Pooja chouhan
Lecture 4 Relationship between pixels
lecture27 on phase change due to ref.ppt
Bilateral filtering for gray and color images

What's hot (20)

PDF
Quantum superposition | Overview
PDF
End-to-End Object Detection with Transformers
PPTX
Chapter 5 diffraction
PDF
Particle Filters and Applications in Computer Vision
PPT
Interfernce
PPT
Eigenface For Face Recognition
PPTX
point operations in image processing
PDF
PR12-094: Model-Agnostic Meta-Learning for fast adaptation of deep networks
PDF
Facebook Deep face
PPT
Nural network ER. Abhishek k. upadhyay
PPT
Hidden Markov Models with applications to speech recognition
PPT
Back propagation
PDF
Lecture 14 Properties of Fourier Transform for 2D Signal
PPTX
Convolutional Neural Network (CNN)
PPTX
Back face detection
PPTX
Model1 Active and Passive Graphics.pptx
PDF
Quantum Computing
PDF
04 image enhancement edge detection
PDF
Making of-the-logistic-map-bifurcation-diagram
Quantum superposition | Overview
End-to-End Object Detection with Transformers
Chapter 5 diffraction
Particle Filters and Applications in Computer Vision
Interfernce
Eigenface For Face Recognition
point operations in image processing
PR12-094: Model-Agnostic Meta-Learning for fast adaptation of deep networks
Facebook Deep face
Nural network ER. Abhishek k. upadhyay
Hidden Markov Models with applications to speech recognition
Back propagation
Lecture 14 Properties of Fourier Transform for 2D Signal
Convolutional Neural Network (CNN)
Back face detection
Model1 Active and Passive Graphics.pptx
Quantum Computing
04 image enhancement edge detection
Making of-the-logistic-map-bifurcation-diagram
Ad

Viewers also liked (16)

PDF
Particle Filter Tracking in Python
PDF
Particle Filter
PPTX
multiple object tracking using particle filter
PDF
Feedback Particle Filter and its Applications to Neuroscience
PDF
Presentation of Visual Tracking
PPTX
Using particle filter for face tracking
PDF
Particle filtering in Computer Vision (2003)
PPTX
Kalman Filter | Statistics
PPT
Single person pose recognition and tracking
PPTX
Kalmanfilter
PDF
Color based image processing , tracking and automation using matlab
PDF
Kalman filter - Applications in Image processing
PPTX
PyCUDAの紹介
PPT
Pose
PDF
ECCV 2016 速報
PDF
【チュートリアル】コンピュータビジョンによる動画認識
Particle Filter Tracking in Python
Particle Filter
multiple object tracking using particle filter
Feedback Particle Filter and its Applications to Neuroscience
Presentation of Visual Tracking
Using particle filter for face tracking
Particle filtering in Computer Vision (2003)
Kalman Filter | Statistics
Single person pose recognition and tracking
Kalmanfilter
Color based image processing , tracking and automation using matlab
Kalman filter - Applications in Image processing
PyCUDAの紹介
Pose
ECCV 2016 速報
【チュートリアル】コンピュータビジョンによる動画認識
Ad

Similar to CS221: HMM and Particle Filters (20)

PDF
Hidden markovmodel
PDF
An overview of Hidden Markov Models (HMM)
PDF
2012 mdsp pr06  hmm
PPT
Hidden Markov Models with applications to speech recognition
PDF
Introduction to Hidden Markov Models
PPTX
Introduction to hmm
PPTX
Applying Hidden Markov Models to Bioinformatics
PPT
PPT
hidden markonov rule rohit marcos do.ppt
PPT
tommy shelby operation on Men United.ppt
PPT
Learning Algorithms For Life Scientists
PPTX
Hidden markov model
PPTX
Presentationhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh1.pptx
PPT
Hidden Markov and Graphical Models presentation
PPT
HMM DAY-3.ppt
PDF
2012 mdsp pr05 particle filter
PPT
HMM (Hidden Markov Model)
PDF
PPTX
Hidden Markov Model (HMM)
PDF
Probabilistic Models of Time Series and Sequences
Hidden markovmodel
An overview of Hidden Markov Models (HMM)
2012 mdsp pr06  hmm
Hidden Markov Models with applications to speech recognition
Introduction to Hidden Markov Models
Introduction to hmm
Applying Hidden Markov Models to Bioinformatics
hidden markonov rule rohit marcos do.ppt
tommy shelby operation on Men United.ppt
Learning Algorithms For Life Scientists
Hidden markov model
Presentationhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh1.pptx
Hidden Markov and Graphical Models presentation
HMM DAY-3.ppt
2012 mdsp pr05 particle filter
HMM (Hidden Markov Model)
Hidden Markov Model (HMM)
Probabilistic Models of Time Series and Sequences

More from zukun (20)

PDF
My lyn tutorial 2009
PDF
ETHZ CV2012: Tutorial openCV
PDF
ETHZ CV2012: Information
PDF
Siwei lyu: natural image statistics
PDF
Lecture9 camera calibration
PDF
Brunelli 2008: template matching techniques in computer vision
PDF
Modern features-part-4-evaluation
PDF
Modern features-part-3-software
PDF
Modern features-part-2-descriptors
PDF
Modern features-part-1-detectors
PDF
Modern features-part-0-intro
PDF
Lecture 02 internet video search
PDF
Lecture 01 internet video search
PDF
Lecture 03 internet video search
PDF
Icml2012 tutorial representation_learning
PPT
Advances in discrete energy minimisation for computer vision
PDF
Gephi tutorial: quick start
PDF
EM algorithm and its application in probabilistic latent semantic analysis
PDF
Object recognition with pictorial structures
PDF
Iccv2011 learning spatiotemporal graphs of human activities
My lyn tutorial 2009
ETHZ CV2012: Tutorial openCV
ETHZ CV2012: Information
Siwei lyu: natural image statistics
Lecture9 camera calibration
Brunelli 2008: template matching techniques in computer vision
Modern features-part-4-evaluation
Modern features-part-3-software
Modern features-part-2-descriptors
Modern features-part-1-detectors
Modern features-part-0-intro
Lecture 02 internet video search
Lecture 01 internet video search
Lecture 03 internet video search
Icml2012 tutorial representation_learning
Advances in discrete energy minimisation for computer vision
Gephi tutorial: quick start
EM algorithm and its application in probabilistic latent semantic analysis
Object recognition with pictorial structures
Iccv2011 learning spatiotemporal graphs of human activities

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Cell Structure & Organelles in detailed.
PPTX
Cell Types and Its function , kingdom of life
PDF
Computing-Curriculum for Schools in Ghana
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
Lesson notes of climatology university.
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Presentation on HIE in infants and its manifestations
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
A systematic review of self-coping strategies used by university students to ...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Anesthesia in Laparoscopic Surgery in India
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Complications of Minimal Access Surgery at WLH
Cell Structure & Organelles in detailed.
Cell Types and Its function , kingdom of life
Computing-Curriculum for Schools in Ghana
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Lesson notes of climatology university.
Microbial diseases, their pathogenesis and prophylaxis
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
STATICS OF THE RIGID BODIES Hibbelers.pdf
Presentation on HIE in infants and its manifestations
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx

CS221: HMM and Particle Filters

  • 1. CS 221: Artificial Intelligence Lecture 5: Hidden Markov Models and Temporal Filtering Sebastian Thrun and Peter Norvig Slide credit: Dan Klein, Michael Pfeiffer
  • 2. Class-On-A-Slide X 5 X 2 E 1 X 1 X 3 X 4 E 2 E 3 E 4 E 5
  • 9. Overview Markov Chains Hidden Markov Models Particle Filters More on HMMs
  • 10. Reasoning over Time Often, we want to reason about a sequence of observations Speech recognition Robot localization User attention Medical monitoring Financial modeling
  • 11. Markov Models A Markov model is a chain-structured BN Each node is identically distributed (stationarity) Value of X at a given time is called the state As a BN: Parameters: called transition probabilities or dynamics, specify how the state evolves over time (also, initial probs) X 2 X 1 X 3 X 4
  • 12. Conditional Independence Basic conditional independence: Past and future independent of the present Each time step only depends on the previous This is called the Markov property Note that the chain is just a (growing) BN We can always use generic BN reasoning on it if we truncate the chain at a fixed length X 2 X 1 X 3 X 4
  • 13. Example: Markov Chain Weather: States: X = {rain, sun} Transitions: Initial distribution: 1.0 sun What ’s the probability distribution after one step? rain sun 0.9 0.9 0.1 0.1 This is a CPT, not a BN!
  • 14. Mini-Forward Algorithm Question: What ’s P(X) on some day t? An instance of variable elimination! sun rain sun rain sun rain sun rain Forward simulation
  • 15. Example From initial observation of sun From initial observation of rain P( X 1 ) P( X 2 ) P( X 3 ) P( X  ) P( X 1 ) P( X 2 ) P( X 3 ) P( X  )
  • 16. Stationary Distributions If we simulate the chain long enough: What happens? Uncertainty accumulates Eventually, we have no idea what the state is! Stationary distributions: For most chains, the distribution we end up in is independent of the initial distribution Called the stationary distribution of the chain Usually, can only predict a short time out
  • 17. Example: Web Link Analysis PageRank over a web graph Each web page is a state Initial distribution: uniform over pages Transitions: With prob. c, uniform jump to a random page (dotted lines, not all shown) With prob. 1-c, follow a random outlink (solid lines) Stationary distribution Will spend more time on highly reachable pages Google 1.0 returned the set of pages containing all your keywords in decreasing rank, now all search engines use link analysis along with many other factors (rank actually getting less important over time)
  • 18. Overview Markov Chains Hidden Markov Models Particle Filters More on HMMs
  • 19. Hidden Markov Models Markov chains not so useful for most agents Eventually you don’t know anything anymore Need observations to update your beliefs Hidden Markov models (HMMs) Underlying Markov chain over states S You observe outputs (effects) at each time step As a Bayes net: X 5 X 2 E 1 X 1 X 3 X 4 E 2 E 3 E 4 E 5
  • 20. Example: Robot Localization t=0 Sensor model: never more than 1 mistake Motion model: may not execute action with small prob. 1 0 Prob Example from Michael Pfeiffer
  • 26. Hidden Markov Model HMMs have two important independence properties: Markov hidden process, future depends on past via the present Current observation independent of all else given current state Quiz: does this mean that observations are mutually independent? [No, correlated by the hidden state] X 5 X 2 E 1 X 1 X 3 X 4 E 2 E 3 E 4 E 5
  • 27. Inference in HMMs (Filtering) E 1 X 1 X 2 X 1
  • 28. Example An HMM is defined by: Initial distribution: Transitions: Emissions:
  • 30. Example: HMMs in Robotics
  • 31. Overview Markov Chains Hidden Markov Models Particle Filters More on HMMs
  • 33. Particle Filtering Sometimes |X| is too big to use exact inference |X| may be too big to even store B(X) E.g. X is continuous |X| 2 may be too big to do updates Solution: approximate inference Track samples of X, not all values Samples are called particles Time per step is linear in the number of samples But: number needed may be large In memory: list of particles, not states This is how robot localization works in practice 0.0 0.1 0.0 0.0 0.0 0.2 0.0 0.2 0.5
  • 34. Representation: Particles Our representation of P(X) is now a list of N particles (samples) Generally, N << |X| Storing map from X to counts would defeat the point P(x) approximated by number of particles with value x So, many x will have P(x) = 0! More particles, more accuracy For now, all particles have a weight of 1 Particles: (3,3) (2,3) (3,3) (3,2) (3,3) (3,2) (2,1) (3,3) (3,3) (2,1)
  • 35. Particle Filtering: Elapse Time Each particle is moved by sampling its next position from the transition model This is like prior sampling – samples ’ frequencies reflect the transition probs Here, most samples move clockwise, but some move in another direction or stay in place This captures the passage of time If we have enough samples, close to the exact values before and after (consistent)
  • 36. Particle Filtering: Observe Slightly trickier: Don ’t do rejection sampling (why not?) We don ’t sample the observation, we fix it This is similar to likelihood weighting, so we downweight our samples based on the evidence Note that, as before, the probabilities don ’t sum to one, since most have been downweighted (in fact they sum to an approximation of P(e))
  • 37. Particle Filtering: Resample Rather than tracking weighted samples, we resample N times, we choose from our weighted sample distribution (i.e. draw with replacement) This is analogous to renormalizing the distribution Now the update is complete for this time step, continue with the next one Old Particles: (3,3) w=0.1 (2,1) w=0.9 (2,1) w=0.9 (3,1) w=0.4 (3,2) w=0.3 (2,2) w=0.4 (1,1) w=0.4 (3,1) w=0.4 (2,1) w=0.9 (3,2) w=0.3 New Particles: (2,1) w=1 (2,1) w=1 (2,1) w=1 (3,2) w=1 (2,2) w=1 (2,1) w=1 (1,1) w=1 (3,1) w=1 (2,1) w=1 (1,1) w=1
  • 43. Particle Filter Algorithm Sample the next generation for particles using the proposal distribution Compute the importance weights : weight = target distribution / proposal distribution Resampling: “Replace unlikely samples by more likely ones”
  • 44. Particle Filter Algorithm Algorithm particle_filter ( S t-1 , u t-1 z t ): For Generate new samples Sample index j(i) from the discrete distribution given by w t-1 Sample from using and Compute importance weight Update normalization factor Insert For Normalize weights
  • 45. Overview Markov Chains Hidden Markov Models Particle Filters More on HMMs
  • 46. Other uses of HMM Find most likely sequence of states Viterbi algorithm Learn HMM parameters from data Baum-Welch (EM) algorithm Other types of HMMs Continuous, Gaussian-linear: Kalman filter Structured transition/emission probabilities: Dynamic Bayes network (DBN)
  • 47. Real HMM Examples Speech recognition HMMs: Observations are acoustic signals (continuous valued) States are specific positions in specific words (so, tens of thousands) Machine translation HMMs: Observations are words (tens of thousands) States are translation options (dozens per word) Robot tracking: Observations are range readings (continuous) States are positions on a map (continuous)
  • 48. HMM Application Domain: Speech Speech input is an acoustic wave form s p ee ch l a b Graphs from Simon Arnfield ’s web tutorial on speech, Sheffield: http://www.psyc.leeds.ac.uk/research/cogn/speech/tutorial/ “ l” to “a” transition:
  • 50. Learning Problem Given example observation trajectories umbrella, umbrella, no-umbrella, umbrella no-umbrella, no-umbrella, no-umbrella … Given: structure of HMM Problem: Learn probabilities P(x), P(x’|x), P(z|x)
  • 51. Learning: Basic Idea Initialize P(x), P(x’|x), P(z|x) randomly Calculate for each sequence z 1 ..z K P(x 1 | z 1 ..z K ), P(x 2 | z 1 ..z K ), …, P(x N | z 1 ..z K ) Those are known as “expectations” Now, compute P(x), P(x’|x), P(z|x) to best match those internal expectations Iterate
  • 52. Let’s first learn a Markov Chain 3 Episodes (R=rain, S=sun) S, R, R, S, S, S, S, S, S, S R, S, S, S, S, R, R, R, R, R S, S, S, R, R, S, S, S, S, S Initial probability P(S) = 2/3 State transition probability P(S’|S) = 5/6 P(R’|R) = 2/3