Presentation is loading. Please wait.

Presentation is loading. Please wait.

HMMs and Particle Filters. Observations and Latent States Markov models don’t get used much in AI. The reason is that Markov models assume that you know.

Similar presentations


Presentation on theme: "HMMs and Particle Filters. Observations and Latent States Markov models don’t get used much in AI. The reason is that Markov models assume that you know."— Presentation transcript:

1 HMMs and Particle Filters

2 Observations and Latent States Markov models don’t get used much in AI. The reason is that Markov models assume that you know exactly what state you are in, at each time step. This is rarely true for AI agents. Instead, we will say that the agent has a set of possible latent states – states that are not observed, or known to the agent. In addition, the agent has sensors that allow it to sense some aspects of the environment, to take measurements or observations.

3 Hidden Markov Models Suppose you are the parent of a college student, and would like to know how studious your child is. You can’t observe them at all times, but you can periodically call, and see if your child answers. SleepStudy 0.5 0.6 0.4 0.5 H1H1 H2H2 H3H3 … SleepStudy 0.5 0.6 0.4 0.5 SleepStudy 0.5 0.6 0.4 0.5 O1O1 O2O2 O3O3 Answer call or not? Answer call or not? Answer call or not?

4 Hidden Markov Models H1H1 H2H2 H3H3 … O1O1 O2O2 O3O3 H1H1 H2H2 P(H 2 |H 1 ) Sleep 0.6 StudySleep0.5 H2H2 H3H3 P(H 3 |H 2 ) Sleep 0.6 StudySleep0.5 H4H4 H3H3 P(H 4 |H 3 ) Sleep 0.6 StudySleep0.5 H1H1 O1O1 P(O 1 |H 1 ) SleepAns0.1 StudyAns0.8 H2H2 O2O2 P(O 2 |H 2 ) SleepAns0.1 StudyAns0.8 H3H3 O3O3 P(O 3 |H 3 ) SleepAns0.1 StudyAns0.8 H1H1 P(H 1 ) Sleep0.5 Study0.5 Here’s the same model, with probabilities in tables.

5 Hidden Markov Models HMMs (and MMs) are a special type of Bayes Net. Everything you have learned about BNs applies here. H1H1 H2H2 H3H3 … O1O1 O2O2 O3O3 H1H1 H2H2 P(H 2 |H 1 ) Sleep 0.6 StudySleep0.5 H2H2 H3H3 P(H 3 |H 2 ) Sleep 0.6 StudySleep0.5 H4H4 H3H3 P(H 4 |H 3 ) Sleep 0.6 StudySleep0.5 H1H1 O1O1 P(O 1 |H 1 ) SleepAns0.1 StudyAns0.8 H2H2 O2O2 P(O 2 |H 2 ) SleepAns0.1 StudyAns0.8 H3H3 O3O3 P(O 3 |H 3 ) SleepAns0.1 StudyAns0.8 H1H1 P(H 1 ) Sleep0.5 Study0.5

6 Quick Review of BNs for HMMs H1H1 O1O1 H1H1 H2H2

7 Hidden Markov Models H1H1 … O1O1 H1H1 H2H2 P(H 2 |H 1 ) Sleep 0.6 StudySleep0.5 H1H1 O1O1 P(O 1 |H 1 ) SleepAns0.1 StudyAns0.8 H1H1 P(H 1 ) Sleep0.5 Study0.5

8 Hidden Markov Models H1H1 O1O1 H1H1 H2H2 P(H 2 |H 1 ) Sleep 0.6 StudySleep0.5 H1H1 O1O1 P(O 1 |H 1 ) SleepAns0.1 StudyAns0.8 H1H1 P(H 1 ) Sleep0.5 Study0.5 H2H2 O2O2

9 Quiz: Hidden Markov Models H1H1 O1O1 H1H1 H2H2 P(H 2 |H 1 ) Sleep 0.6 StudySleep0.5 H1H1 O1O1 P(O 1 |H 1 ) SleepAns0.1 StudyAns0.8 H1H1 P(H 1 ) Sleep0.5 Study0.5 H2H2 O2O2 Suppose a parent calls twice, once at time step 1 and once at time step 2. The first time, the child does not answer, and the second time the child does. Now what is P(H 2 =Sleep)?

10 Answer: Hidden Markov Models H1H1 O1O1 H1H1 H2H2 P(H 2 |H 1 ) Sleep 0.6 StudySleep0.5 H1H1 O1O1 P(O 1 |H 1 ) SleepAns0.1 StudyAns0.8 H1H1 P(H 1 ) Sleep0.5 Study0.5 H2H2 O2O2 It’s a pain to calculate by Enumeration.

11 Quiz: Complexity of Enumeration for HMMs

12 Answer: Complexity of Enumeration for HMMs

13 Specialized Inference Algorithm: Dynamic Programming

14 Demo of HMM Robot Localization Youtube demo from Udacity.com’s AI course: https://www.youtube.com/watch?v=Nc9- iLy_rgY&feature=player_embedded 1-dimensional robot demo: https://www.youtube.com/watch?v=8mi8z- EnYq8&feature=player_embedded

15 Particle Filter Demos Real robot localization with particle filter: https://www.youtube.com/watch?v=H0G1yslM5 rc&feature=player_embedded 1-dimensional case: https://www.youtube.com/watch?v=qQQYkvS5 CzU&feature=player_embedded

16 Particle Filter Algorithm Inputs: – set of particles S, each with location s i.loc and weight s i.w – Control vector u (where robot should move next) – Measurement vector z (sensor readings) Outputs: – New particles S’, for the next iteration

17 Particle Filter Algorithm


Download ppt "HMMs and Particle Filters. Observations and Latent States Markov models don’t get used much in AI. The reason is that Markov models assume that you know."

Similar presentations


Ads by Google