Hidden Markov Models. AIMA Chapter 15, Sections 1 5. AIMA Chapter 15, Sections 1 5 1

Similar documents
Hidden Markov models 1

PROBABILISTIC REASONING OVER TIME

Temporal probability models. Chapter 15

Temporal probability models. Chapter 15, Sections 1 5 1

CS532, Winter 2010 Hidden Markov Models

Dynamic Bayesian Networks and Hidden Markov Models Decision Trees

Course Overview. Summary. Performance of approximation algorithms

Hidden Markov Models (recap BNs)

Hidden Markov Models,99,100! Markov, here I come!

CSE 473: Artificial Intelligence

CSCI 360 Introduc/on to Ar/ficial Intelligence Week 2: Problem Solving and Op/miza/on. Professor Wei-Min Shen Week 8.1 and 8.2

Lecture 4: State Estimation in Hidden Markov Models (cont.)

Human-Oriented Robotics. Temporal Reasoning. Kai Arras Social Robotics Lab, University of Freiburg

Extensions of Bayesian Networks. Outline. Bayesian Network. Reasoning under Uncertainty. Features of Bayesian Networks.

CS 5522: Artificial Intelligence II

CS 5522: Artificial Intelligence II

CSEP 573: Artificial Intelligence

Hidden Markov Models. Hal Daumé III. Computer Science University of Maryland CS 421: Introduction to Artificial Intelligence 19 Apr 2012

CSE 473: Artificial Intelligence Spring 2014

Markov Chains and Hidden Markov Models

PROBABILISTIC REASONING Outline

CS 343: Artificial Intelligence

Lecture 4: Hidden Markov Models: An Introduction to Dynamic Decision Making. November 11, 2010

CS 188: Artificial Intelligence Fall Recap: Inference Example

Markov Models. CS 188: Artificial Intelligence Fall Example. Mini-Forward Algorithm. Stationary Distributions.

CS 188: Artificial Intelligence Spring 2009

CSE 473: Ar+ficial Intelligence. Probability Recap. Markov Models - II. Condi+onal probability. Product rule. Chain rule.

Linear Dynamical Systems (Kalman filter)

Markov Models and Hidden Markov Models

CS 343: Artificial Intelligence

CS 343: Artificial Intelligence

Approximate Inference

CS 7180: Behavioral Modeling and Decision- making in AI

CS 188: Artificial Intelligence Fall 2011

Announcements. CS 188: Artificial Intelligence Fall Markov Models. Example: Markov Chain. Mini-Forward Algorithm. Example

Announcements. CS 188: Artificial Intelligence Fall VPI Example. VPI Properties. Reasoning over Time. Markov Models. Lecture 19: HMMs 11/4/2008

Hidden Markov Models. Vibhav Gogate The University of Texas at Dallas

Introduction to Artificial Intelligence (AI)

CS 5522: Artificial Intelligence II

CS 5522: Artificial Intelligence II

Reasoning Under Uncertainty Over Time. CS 486/686: Introduction to Artificial Intelligence

Temporal probability models

Advanced Data Science

CS 188: Artificial Intelligence Spring Announcements

Hidden Markov Models. Aarti Singh Slides courtesy: Eric Xing. Machine Learning / Nov 8, 2010

STA 4273H: Statistical Machine Learning

Machine Learning for Data Science (CS4786) Lecture 19

Hidden Markov Models. George Konidaris

Linear Dynamical Systems

Hidden Markov Models. By Parisa Abedi. Slides courtesy: Eric Xing

CS 7180: Behavioral Modeling and Decision- making in AI

9 Forward-backward algorithm, sum-product on factor graphs

CS325 Artificial Intelligence Ch. 15,20 Hidden Markov Models and Particle Filtering

Mini-project 2 (really) due today! Turn in a printout of your work at the end of the class

CS 188: Artificial Intelligence

CSE 473: Ar+ficial Intelligence

CS711008Z Algorithm Design and Analysis

Outline. CSE 573: Artificial Intelligence Autumn Agent. Partial Observability. Markov Decision Process (MDP) 10/31/2012

Our Status in CSE 5522

Introduction to Machine Learning CMU-10701

CS 188: Artificial Intelligence. Our Status in CS188

STA 414/2104: Machine Learning

Lecture 11: Hidden Markov Models

CS188 Outline. We re done with Part I: Search and Planning! Part II: Probabilistic Reasoning. Part III: Machine Learning

Markov localization uses an explicit, discrete representation for the probability of all position in the state space.

Bayesian Networks BY: MOHAMAD ALSABBAGH

Final Exam December 12, 2017

Kalman filtering and friends: Inference in time series models. Herke van Hoof slides mostly by Michael Rubinstein

Note Set 5: Hidden Markov Models

Probability, Markov models and HMMs. Vibhav Gogate The University of Texas at Dallas

COMS 4771 Probabilistic Reasoning via Graphical Models. Nakul Verma

Hidden Markov Models

Robert Collins CSE586 CSE 586, Spring 2015 Computer Vision II

Temporal probability models. Chapter 15, Sections 1 5 1

Probability. CS 3793/5233 Artificial Intelligence Probability 1

Bayesian Methods in Artificial Intelligence

CS188 Outline. CS 188: Artificial Intelligence. Today. Inference in Ghostbusters. Probability. We re done with Part I: Search and Planning!

Markov Chains and Hidden Markov Models

Our Status. We re done with Part I Search and Planning!

CS 7180: Behavioral Modeling and Decision- making in AI

Bayesian Machine Learning - Lecture 7

COMP90051 Statistical Machine Learning

LEARNING DYNAMIC SYSTEMS: MARKOV MODELS

CSE 473: Artificial Intelligence Probability Review à Markov Models. Outline

Bayesian Networks: Construction, Inference, Learning and Causal Interpretation. Volker Tresp Summer 2016

Bayesian Networks: Construction, Inference, Learning and Causal Interpretation. Volker Tresp Summer 2014

Intelligent Systems (AI-2)

Computational Biology Lecture #3: Probability and Statistics. Bud Mishra Professor of Computer Science, Mathematics, & Cell Biology Sept

Reasoning Under Uncertainty: Bayesian networks intro

Intelligent Systems (AI-2)

1/30/2012. Reasoning with uncertainty III

Modeling and state estimation Examples State estimation Probabilities Bayes filter Particle filter. Modeling. CSC752 Autonomous Robotic Systems

Introduction to Hidden Markov Modeling (HMM) Daniel S. Terry Scott Blanchard and Harel Weinstein labs

order is number of previous outputs

Chapter 05: Hidden Markov Models

Sequence labeling. Taking collective a set of interrelated instances x 1,, x T and jointly labeling them

Hidden Markov models

Hidden Markov Model. Ying Wu. Electrical Engineering and Computer Science Northwestern University Evanston, IL 60208

Probabilistic Robotics

Probability and Time: Hidden Markov Models (HMMs)

Transcription:

Hidden Markov Models AIMA Chapter 15, Sections 1 5 AIMA Chapter 15, Sections 1 5 1

Consider a target tracking problem Time and uncertainty X t = set of unobservable state variables at time t e.g., Position t, Appearance t, etc. E t = set of observable evidence variables at time t e.g., Imagepixels t This assumes discrete time; step size depends on problem Notation: X a:b = X a,x a+1,...,x b 1,X b AIMA Chapter 15, Sections 1 5 2

Markov processes (Markov chains) Construct a Bayes net from these variables: Markov assumption: X t depends on bounded subset of X 0:t 1 First-order Markov process: P(X t X 0:t 1 ) = P(X t X t 1 ) Second-order Markov process: P(X t X 0:t 1 ) = P(X t X t 2,X t 1 ) First order X t 2 X t 1 X t X t +1 X t +2 Second order X t 2 X t 1 X t X t +1 X t +2 Stationary process: transition model P(X t X t 1 ) fixed for all t AIMA Chapter 15, Sections 1 5 3

Hidden Markov Model (HMM) Sensor Markov assumption: P(E t X 0:t,E 1:t 1 ) = P(E t X t ) Stationary process: transition model P(X t X t 1 ) and sensor model P(E t X t ) fixed for all t HMM is a special type of Bayes net, X t is single discrete random variable: with joint probability distribution P(X 0:t,E 1:t ) = P(X 0 )Π t i=1p(x i X i 1 )P(E i X i ) AIMA Chapter 15, Sections 1 5 4

Example Rain t 1 R t 1 t f P(R t ) 0.7 0.3 Rain t Rain t +1 Rt t f P(U t ) 0.9 0.2 Umbrella t 1 Umbrella t Umbrella t +1 First-order Markov assumption not exactly true in real world! Possible fixes: 1. Increase order of Markov process 2. Augment state, e.g., add Temp t, Pressure t Example: robot motion. Augment position and velocity with Battery t AIMA Chapter 15, Sections 1 5 5

Inference tasks Filtering: P(X t e 1:t ) belief state input to the decision process of a rational agent Prediction: P(X t+k e 1:t ) for k > 0 evaluation of possible action sequences; like filtering without the evidence Smoothing: P(X k e 1:t ) for 0 k < t better estimate of past states, essential for learning Most likely explanation: arg max x1:t P(x 1:t e 1:t ) speech recognition, decoding with a noisy channel AIMA Chapter 15, Sections 1 5 6

Filtering Aim: devise a recursive state estimation algorithm: P(X t+1 e 1:t+1 ) = f(e t+1,p(x t e 1:t )) AIMA Chapter 15, Sections 1 5 7

Filtering Aim: devise a recursive state estimation algorithm: P(X t+1 e 1:t+1 ) = f(e t+1,p(x t e 1:t )) P(X t+1 e 1:t+1 ) = P(X t+1 e 1:t,e t+1 ) = αp(e t+1 X t+1,e 1:t )P(X t+1 e 1:t ) = αp(e t+1 X t+1 )P(X t+1 e 1:t ) AIMA Chapter 15, Sections 1 5 8

Filtering Aim: devise a recursive state estimation algorithm: P(X t+1 e 1:t+1 ) = f(e t+1,p(x t e 1:t )) P(X t+1 e 1:t+1 ) = P(X t+1 e 1:t,e t+1 ) = αp(e t+1 X t+1,e 1:t )P(X t+1 e 1:t ) = αp(e t+1 X t+1 )P(X t+1 e 1:t ) I.e., prediction + estimation. Prediction by summing out X t : P(X t+1 e 1:t+1 ) = αp(e t+1 X t+1 )Σ xt P(X t+1,x t e 1:t ) = αp(e t+1 X t+1 )Σ xt P(X t+1 x t,e 1:t )P(x t e 1:t ) = αp(e t+1 X t+1 )Σ xt P(X t+1 x t )P(x t e 1:t ) AIMA Chapter 15, Sections 1 5 9

Filtering Aim: devise a recursive state estimation algorithm: P(X t+1 e 1:t+1 ) = f(e t+1,p(x t e 1:t )) P(X t+1 e 1:t+1 ) = P(X t+1 e 1:t,e t+1 ) = αp(e t+1 X t+1,e 1:t )P(X t+1 e 1:t ) = αp(e t+1 X t+1 )P(X t+1 e 1:t ) I.e., prediction + estimation. Prediction by summing out X t : P(X t+1 e 1:t+1 ) = αp(e t+1 X t+1 )Σ xt P(X t+1,x t e 1:t ) = αp(e t+1 X t+1 )Σ xt P(X t+1 x t,e 1:t )P(x t e 1:t ) = αp(e t+1 X t+1 )Σ xt P(X t+1 x t )P(x t e 1:t ) f 1:t+1 = Forward(f 1:t,e t+1 ) where f 1:t =P(X t e 1:t ) Time and space constant (independent of t) AIMA Chapter 15, Sections 1 5 10

Filtering example 0.500 0.500 0.627 0.373 True False 0.500 0.500 0.818 0.182 0.883 0.117 Rain 0 Rain 1 Rain 2 Umbrella 1 Umbrella 2 P(X t+1 e 1:t+1 ) = αp(e t+1 X t+1 )Σ xt P(X t+1 x t )P(x t e 1:t ) R t 1 P(R t ) t 0.7 f 0.3 R t P(U t ) t 0.9 f 0.2 AIMA Chapter 15, Sections 1 5 11

Smoothing X 0 X 1 X k X t E1 E k Et Divide evidence e 1:t into e 1:k, e k+1:t : P(X k e 1:t ) = P(X k e 1:k,e k+1:t ) = αp(x k e 1:k )P(e k+1:t X k,e 1:k ) = αp(x k e 1:k )P(e k+1:t X k ) = αf 1:k b k+1:t AIMA Chapter 15, Sections 1 5 12

Smoothing X 0 X 1 X k X t E1 E k Et Divide evidence e 1:t into e 1:k, e k+1:t : P(X k e 1:t ) = P(X k e 1:k,e k+1:t ) = αp(x k e 1:k )P(e k+1:t X k,e 1:k ) = αp(x k e 1:k )P(e k+1:t X k ) = αf 1:k b k+1:t Backward message computed by a backwards recursion: P(e k+1:t X k ) = Σ xk+1 P(e k+1:t X k,x k+1 )P(x k+1 X k ) = Σ xk+1 P(e k+1:t x k+1 )P(x k+1 X k ) = Σ xk+1 P(e k+1 x k+1 )P(e k+2:t x k+1 )P(x k+1 X k ) AIMA Chapter 15, Sections 1 5 13

Smoothing example 0.500 0.500 0.627 0.373 True False 0.500 0.500 0.818 0.182 0.883 0.117 forward 0.883 0.117 0.883 0.117 smoothed 0.690 0.410 1.000 1.000 backward Rain 0 Rain 1 Rain 2 Umbrella 1 Umbrella 2 Forward backward algorithm: cache forward messages along the way Time linear in t (polytree inference), space O(t f ) AIMA Chapter 15, Sections 1 5 14

Most likely explanation AIMA Chapter 15, Sections 1 5 15

Most likely explanation Most likely sequence sequence of most likely states!!!! Most likely path to each x t+1 = most likely path to some x t plus one more step max P(x x 1...x 1,...,x t,x t+1 e 1:t+1 ) t = P(e t+1 X t+1 ) max P(Xt+1 x x t ) max P(x t x 1...x 1,...,x t 1,x t e 1:t ) t 1 Identical to filtering, except f 1:t replaced by m 1:t = max x 1...x t 1 P(x 1,...,x t 1,X t e 1:t ), I.e., m 1:t (i) gives the probability of the most likely path to state i. Update has sum replaced by max, giving the Viterbi algorithm: m 1:t+1 = P(e t+1 X t+1 ) max x t (P(X t+1 x t )m 1:t ) AIMA Chapter 15, Sections 1 5 16

Viterbi example Rain 1 Rain 2 Rain 3 Rain 4 Rain 5 state space paths true false true false true false true false true false umbrella true true false true true most likely paths.8182.5155.0361.0334.0210.1818.0491.1237.0173.0024 m 1:1 m 1:2 m 1:3 m 1:4 m 1:5 AIMA Chapter 15, Sections 1 5 17

Example Umbrella Problems Filtering: P(X t+1 e 1:t+1 ) = αp(e t+1 X t+1 )Σ xt P(X t+1 x t )P(x t e 1:t ) =: f 1:t+1 Smoothing: P(X k e 1:t ) = αf 1:k b k+1:t P(e k+1:t X k ) = Σ xk+1 P(e k+1 x k+1 )P(e k+2:t x k+1 )P(x k+1 X k ) =: b k+1:t R t 1 P(R t ) t 0.7 f 0.3 R t P(U t ) t 0.9 f 0.2 P(R 3 u 1, u 2, u 3 ) =? arg maxp(r 1:3 u 1, u 2, u 3 ) =? R 1:3 P(R 2 u 1, u 2, u 3 ) =? AIMA Chapter 15, Sections 1 5 18