Probability and Time: Hidden Markov Models (HMMs)

Slides:



Advertisements
Similar presentations
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Advertisements

Decision Theory: Sequential Decisions Computer Science cpsc322, Lecture 34 (Textbook Chpt 9.3) Nov, 28, 2012.
Lecture 11 Probability and Time
Department of Computer Science Undergraduate Events More
Slide 1 Planning: Representation and Forward Search Jim Little UBC CS 322 October 10, 2014 Textbook §8.1 (Skip )- 8.2)
CPSC 322, Lecture 2Slide 1 Representational Dimensions Computer Science cpsc322, Lecture 2 (Textbook Chpt1) Sept, 6, 2013.
CPSC 502, Lecture 11Slide 1 Introduction to Artificial Intelligence (AI) Computer Science cpsc502, Lecture 11 Oct, 18, 2011.
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) March, 16, 2009.
CPSC 322, Lecture 19Slide 1 Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt ) February, 23, 2009.
Decision Theory: Single Stage Decisions Computer Science cpsc322, Lecture 33 (Textbook Chpt 9.2) March, 30, 2009.
CPSC 322, Lecture 37Slide 1 Finish Markov Decision Processes Last Class Computer Science cpsc322, Lecture 37 (Textbook Chpt 9.5) April, 8, 2009.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) January, 12, 2009.
CPSC 322, Lecture 18Slide 1 Planning: Heuristics and CSP Planning Computer Science cpsc322, Lecture 18 (Textbook Chpt 8) February, 12, 2010.
CPSC 322, Lecture 30Slide 1 Reasoning Under Uncertainty: Variable elimination Computer Science cpsc322, Lecture 30 (Textbook Chpt 6.4) March, 23, 2009.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
CPSC 322, Lecture 31Slide 1 Probability and Time: Markov Models Computer Science cpsc322, Lecture 31 (Textbook Chpt 6.5) March, 25, 2009.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) March, 8, 2010.
CPSC 322, Lecture 32Slide 1 Probability and Time: Hidden Markov Models (HMMs) Computer Science cpsc322, Lecture 32 (Textbook Chpt 6.5) March, 27, 2009.
CPSC 422, Lecture 14Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14 Feb, 4, 2015 Slide credit: some slides adapted from Stuart.
CPSC 322, Lecture 35Slide 1 Value of Information and Control Computer Science cpsc322, Lecture 35 (Textbook Chpt 9.4) April, 14, 2010.
CS 188: Artificial Intelligence Fall 2009 Lecture 19: Hidden Markov Models 11/3/2009 Dan Klein – UC Berkeley.
CPSC 322, Lecture 24Slide 1 Reasoning under Uncertainty: Intro to Probability Computer Science cpsc322, Lecture 24 (Textbook Chpt 6.1, 6.1.1) March, 15,
Simultaneous Localization and Mapping Presented by Lihan He Apr. 21, 2006.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 26, 2010.
Department of Computer Science Undergraduate Events More
CPSC 322, Lecture 32Slide 1 Probability and Time: Hidden Markov Models (HMMs) Computer Science cpsc322, Lecture 32 (Textbook Chpt 6.5.2) Nov, 25, 2013.
The famous “sprinkler” example (J. Pearl, Probabilistic Reasoning in Intelligent Systems, 1988)
CPSC 322, Lecture 19Slide 1 (finish Planning) Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt – 5.2) Oct,
CPSC 422, Lecture 17Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 17 Oct, 19, 2015 Slide Sources D. Koller, Stanford CS - Probabilistic.
CPSC 322, Lecture 2Slide 1 Representational Dimensions Computer Science cpsc322, Lecture 2 (Textbook Chpt1) Sept, 7, 2012.
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) Nov, 13, 2013.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 30, 2013.
Example: Localization for “Pushed around” Robot
Please Also Complete Teaching Evaluations
Reasoning Under Uncertainty: Belief Networks
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 3
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 2
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Propositional Definite Clause Logic: Syntax, Semantics, R&R and Proofs
Planning: Forward Planning and CSP Planning
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 7
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 3
Reasoning Under Uncertainty: Conditioning, Bayes Rule & Chain Rule
Planning: Representation and Forward Search
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14
Markov ó Kalman Filter Localization
Decision Theory: Single Stage Decisions
Planning: Heuristics and CSP Planning
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Planning: Representation and Forward Search
Probability and Time: Markov Models
Probability and Time: Markov Models
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 2
Decision Theory: Sequential Decisions
Decision Theory: Single Stage Decisions
Probability and Time: Markov Models
Please Also Complete Teaching Evaluations
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14
Logic: Domain Modeling /Proofs + Computer Science cpsc322, Lecture 22
Probability and Time: Markov Models
Reasoning Under Uncertainty: Variable elimination
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 7
Planning: Representation and Forward Search
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 3
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 7
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14
Presentation transcript:

Probability and Time: Hidden Markov Models (HMMs) Computer Science cpsc322, Lecture 32 (Textbook Chpt 6.5.2) June, 20, 2017 CPSC 322, Lecture 32

Recap Markov Models Lecture Overview Markov Chain Hidden Markov Models CPSC 322, Lecture 32

Answering Queries under Uncertainty Probability Theory Dynamic Bayesian Network Static Belief Network & Variable Elimination Hidden Markov Models Student Tracing in tutoring Systems Monitoring (e.g credit cards) Robotics BioInformatics Markov Chains Natural Language Processing Diagnostic Systems (e.g., medicine) Email spam filters CPSC 322, Lecture 32

Stationary Markov Chain (SMC) A stationary Markov Chain : for all t >0 P (St+1| S0,…,St) = and P (St +1| We only need to specify and Simple Model, easy to specify Often the natural model The network can extend indefinitely Variations of SMC are at the core of most Natural Language Processing (NLP) applications! CPSC 322, Lecture 32 4

Recap Markov Models Lecture Overview Markov Chain Hidden Markov Models CPSC 322, Lecture 32

How can we minimally extend Markov Chains? Maintaining the Markov and stationary assumptions? A useful situation to model is the one in which: the reasoning system does not have access to the states but can make observations that give some information about the current state CPSC 322, Lecture 32 6

Hidden Markov Model A Hidden Markov Model (HMM) starts with a Markov chain, and adds a noisy observation about the state at each time step: |domain(S)| = k |domain(O)| = h P (S0) specifies initial conditions P (St+1|St) specifies the dynamics P (Ot |St) specifies the sensor model A. 2 x h B. h x h C . k x h CPSC 322, Lecture 32 D. k x k

Hidden Markov Model A Hidden Markov Model (HMM) starts with a Markov chain, and adds a noisy observation about the state at each time step: |domain(S)| = k |domain(O)| = h P (S0) specifies initial conditions P (St+1|St) specifies the dynamics P (Ot |St) specifies the sensor model CPSC 322, Lecture 32

Example: Localization for “Pushed around” Robot Localization (where am I?) is a fundamental problem in robotics Suppose a robot is in a circular corridor with 16 locations There are four doors at positions: 2, 4, 7, 11 The Robot initially doesn’t know where it is The Robot is pushed around. After a push it can stay in the same location, move left or right. The Robot has a Noisy sensor telling whether it is in front of a door Simultaneous localization and mapping (SLAM) is a technique used by robots and autonomous vehicles to build up a map within an unknown environment while at the same time keeping track of their current position. This is not as straightforward as it might sound due to inherent uncertainties in discerning the robot's relative movement from its various sensors. If at the next iteration of map building the measured distance and direction travelled has a slight inaccuracy, then any features being added to the map will contain corresponding errors. If unchecked, these positional errors build cumulatively, grossly distorting the map and therefore the robot's ability to know its precise location. There are various techniques to compensate for this such as recognising features that it has come across previously and re-skewing recent parts of the map to make sure the two instances of that feature become one. Some of the statistical techniques used in SLAM include Kalman filters, particle filters (aka. Monte Carlo methods) and scan matching of range data. CPSC 322, Lecture 32

This scenario can be represented as… Example Stochastic Dynamics: when pushed, it stays in the same location p=0.2, moves one step left or right with equal probability P(Loct + 1 | Loc t) A. How many values for Loc i? Loc t= 10 B. C.

This scenario can be represented as… Example Stochastic Dynamics: when pushed, it stays in the same location p=0.2, moves left or right with equal probability P(Loct + 1 | Loc t) How many values for Loc i? P(Loc1) CPSC 322, Lecture 32

This scenario can be represented as… Example of Noisy sensor telling whether it is in front of a door. If it is in front of a door P(O t = T) = .8 If not in front of a door P(O t = T) = .1 P(O t | Loc t) How many values for Loc i? CPSC 322, Lecture 32

Useful inference in HMMs Localization: Robot starts at an unknown location and it is pushed around t times. It wants to determine where it is In general: compute the posterior distribution over the current state given all evidence to date P(St | O0 … Ot) CPSC 322, Lecture 32 13

Example : Robot Localization Suppose a robot wants to determine its location based on its actions and its sensor readings Three actions: goRight, goLeft, Stay This can be represented by an augmented HMM (Note: in this example the robot is not choosing its actions) CPSC 322, Lecture 32

Robot Localization Sensor and Dynamics Model Sample Sensor Model (assume same as for pushed around) Sample Stochastic Dynamics: P(Loct + 1 | Actiont , Loc t) P(Loct + 1 = L | Action t = goRight , Loc t = L) = 0.1 P(Loct + 1 = L+1 | Action t = goRight , Loc t = L) = 0.8 P(Loct + 1 = L + 2 | Action t = goRight , Loc t = L) = 0.074 P(Loct + 1 = L’ | Action t = goRight , Loc t = L) = 0.002 for all other locations L’ All location arithmetic is modulo 16 The action goLeft works the same but to the left CPSC 322, Lecture 32

Dynamics Model More Details Sample Stochastic Dynamics: P(Loct + 1 | Action, Loc t) P(Loct + 1 = L | Action t = goRight , Loc t = L) = 0.1 P(Loct + 1 = L+1 | Action t = goRight , Loc t = L) = 0.8 P(Loct + 1 = L + 2 | Action t = goRight , Loc t = L) = 0.074 P(Loct + 1 = L’ | Action t = goRight , Loc t = L) = 0.002 for all other locations L’ CPSC 322, Lecture 32

Robot Localization additional sensor Additional Light Sensor: there is light coming through an opening at location 10 P (Lt | Loct) Info from the two sensors is combined :“Sensor Fusion” CPSC 322, Lecture 32

The Robot starts at an unknown location and must determine where it is The model appears to be too ambiguous Sensors are too noisy Dynamics are too stochastic to infer anything But inference actually works pretty well. You can check it at : http://www.cs.ubc.ca/spider/poole/demos/localization/localization.html You can use standard Bnet inference. However you typically take advantage of the fact that time moves forward (not in 322) CPSC 322, Lecture 32

Sample scenario to explore in demo Keep making observations without moving. What happens? Then keep moving without making observations. What happens? Assume you are at a certain position alternate moves and observations …. CPSC 322, Lecture 32

HMMs have many other applications…. Natural Language Processing: e.g., Speech Recognition States: phoneme \ word Observations: acoustic signal \ phoneme Bioinformatics: Gene Finding States: coding / non-coding region Observations: DNA Sequences For these problems the critical inference is: find the most likely sequence of states given a sequence of observations ahone is a speech sound CPSC 322, Lecture 32

Markov Models Simplest Possible Dynamic Bnet Markov Chains Add noisy Observations about the state at time t Hidden Markov Model Add Actions and Values (Rewards) Markov Decision Processes (MDPs) CPSC 322, Lecture 32

Learning Goals for today’s class You can: Specify the components of an Hidden Markov Model (HMM) Justify and apply HMMs to Robot Localization Clarification on second LG for last class You can: Justify and apply Markov Chains to compute the probability of a Natural Language sentence (NOT to estimate the conditional probs- slide 18) CPSC 322, Lecture 32

Constraint Satisfaction Next week Environment Stochastic Deterministic Problem Arc Consistency Search Constraint Satisfaction Vars + Constraints SLS Static Belief Nets Logics Query Var. Elimination Search Markov Chains and HMMs R&R Sys Representation and reasoning Systems Each cell is a R&R system STRIPS actions preconditions and effects Sequential Decision Nets STRIPS Var. Elimination Planning Search Markov Decision Processes Representation Value Iteration Reasoning Technique CPSC 322, Lecture 32

Final Exam (2.5 hours) Room: BUCH A101 Next Class One-off decisions(TextBook 9.2) Single Stage Decision networks ( 9.2.1) Final Thu, Jun 29 at 19:00 Final Exam (2.5 hours) Room: BUCH A101   CPSC 322, Lecture 32