CPSC 422, Lecture 14Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14 Feb, 4, 2015 Slide credit: some slides adapted from Stuart.

Slides:



Advertisements
Similar presentations
CPSC 422, Lecture 16Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 16 Feb, 11, 2015.
Advertisements

Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 20
Department of Computer Science Undergraduate Events More
Lirong Xia Probabilistic reasoning over time Tue, March 25, 2014.
Modeling Uncertainty over time Time series of snapshot of the world “state” we are interested represented as a set of random variables (RVs) – Observable.
Lirong Xia Hidden Markov Models Tue, March 28, 2014.
Reasoning Under Uncertainty: Bayesian networks intro Jim Little Uncertainty 4 November 7, 2014 Textbook §6.3, 6.3.1, 6.5, 6.5.1,
Hidden Markov Models Reading: Russell and Norvig, Chapter 15, Sections
Advanced Artificial Intelligence
1 Reasoning Under Uncertainty Over Time CS 486/686: Introduction to Artificial Intelligence Fall 2013.
… Hidden Markov Models Markov assumption: Transition model:
CS 188: Artificial Intelligence Fall 2009 Lecture 20: Particle Filtering 11/5/2009 Dan Klein – UC Berkeley TexPoint fonts used in EMF. Read the TexPoint.
Part 2 of 3: Bayesian Network and Dynamic Bayesian Network.
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 32Slide 1 Probability and Time: Hidden Markov Models (HMMs) Computer Science cpsc322, Lecture 32 (Textbook Chpt 6.5) March, 27, 2009.
Department of Computer Science Undergraduate Events More
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,
CHAPTER 15 SECTION 3 – 4 Hidden Markov Models. Terminology.
QUIZ!!  T/F: The forward algorithm is really variable elimination, over time. TRUE  T/F: Particle Filtering is really sampling, over time. TRUE  T/F:
Reasoning Under Uncertainty: Bayesian networks intro CPSC 322 – Uncertainty 4 Textbook §6.3 – March 23, 2011.
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.
UIUC CS 498: Section EA Lecture #21 Reasoning in Artificial Intelligence Professor: Eyal Amir Fall Semester 2011 (Some slides from Kevin Murphy (UBC))
CS 416 Artificial Intelligence Lecture 17 Reasoning over Time Chapter 15 Lecture 17 Reasoning over Time Chapter 15.
CPSC 422, Lecture 15Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 15 Oct, 14, 2015.
CPSC 422, Lecture 11Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11 Oct, 2, 2015.
CPSC 322, Lecture 33Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 33 Nov, 30, 2015 Slide source: from David Page (MIT) (which were.
QUIZ!!  In HMMs...  T/F:... the emissions are hidden. FALSE  T/F:... observations are independent given no evidence. FALSE  T/F:... each variable X.
CPSC 422, Lecture 19Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 19 Oct, 23, 2015 Slide Sources Raymond J. Mooney University of.
Decision Making Under Uncertainty CMSC 471 – Spring 2014 Class #12– Thursday, March 6 R&N, Chapters , material from Lise Getoor, Jean-Claude.
CPSC 422, Lecture 17Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 17 Oct, 19, 2015 Slide Sources D. Koller, Stanford CS - Probabilistic.
CPS 170: Artificial Intelligence Markov processes and Hidden Markov Models (HMMs) Instructor: Vincent Conitzer.
Probability and Time. Overview  Modelling Evolving Worlds with Dynamic Baysian Networks  Simplifying Assumptions Stationary Processes, Markov Assumption.
Reasoning Under Uncertainty: Independence and Inference CPSC 322 – Uncertainty 5 Textbook §6.3.1 (and for HMMs) March 25, 2011.
Probability and Time. Overview  Modelling Evolving Worlds with Dynamic Baysian Networks  Simplifying Assumptions Stationary Processes, Markov Assumption.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
CS 541: Artificial Intelligence Lecture VIII: Temporal Probability Models.
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 12
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 10
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 16
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 7
Instructor: Vincent Conitzer
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 15
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 17
Probabilistic Reasoning over Time
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 20
Probability and Time: Markov Models
UBC Department of Computer Science Undergraduate Events More
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 16
Probability and Time: Markov Models
CS 188: Artificial Intelligence Spring 2007
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 16
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 2
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 12
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 17
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 15
Probability and Time: Markov Models
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14
Probability and Time: Markov Models
Instructor: Vincent Conitzer
Instructor: Vincent Conitzer
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 7
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 7
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 12
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14
Presentation transcript:

CPSC 422, Lecture 14Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14 Feb, 4, 2015 Slide credit: some slides adapted from Stuart Russell (Berkeley)

422 big picture: Where are we? Query Planning DeterministicStochastic Value Iteration Approx. Inference Full Resolution SAT Logics Belief Nets Markov Decision Processes and Partially Observable MDP Markov Chains and HMMs First Order Logics Ontologies Temporal rep. Applications of AI Approx. : Gibbs Undirected Graphical Models Markov Networks Conditional Random Fields Reinforcement Learning Representation Reasoning Technique Prob CFG Prob Relational Models Markov Logics Hybrid: Det +Sto Forward, Viterbi…. Approx. : Particle Filtering CPSC 322, Lecture 34Slide 2

CPSC 422, Lecture 143 Lecture Overview (Temporal Inference) Filtering (posterior distribution over the current state given evidence to date) From intuitive explanation to formal derivation Example Prediction ( posterior distribution over a future state given evidence to date ) (start) Smoothing (posterior distribution over a past state given all evidence to date)

Slide 4 Markov Models Markov Chains Hidden Markov Model Markov Decision Processes (MDPs) CPSC422, Lecture 5 Partially Observable Markov Decision Processes (POMDPs)

CPSC422, Lecture 5Slide 5 Hidden Markov Model P (X 0 ) specifies initial conditions P (X t+1 |X t ) specifies the dynamics P (E t |S t ) specifies the sensor model A Hidden Markov Model (HMM) starts with a Markov chain, and adds a noisy observation/evidence about the state at each time step: |domain(X)| = k |domain(E)| = h

Simple Example (We’ll use this as a running example)  Guard stuck in a high-security bunker  Would like to know if it is raining outside  Can only tell by looking at whether his boss comes into the bunker with an umbrella every day Transition model State variables Observable variables Observation model

Useful inference in HMMs In general (Filtering): compute the posterior distribution over the current state given all evidence to date Slide 7CPSC422, Lecture 5 P(X t | e 0:t )

Intuitive Explanation for filtering recursive formula Slide 8CPSC422, Lecture 5 P(X t | e 0:t )

Filtering  Idea: recursive approach Compute filtering up to time t-1, and then include the evidence for time t (recursive estimation)‏  P(X t | e 0:t ) = P(X t | e 0:t-1,e t ) dividing up the evidence = α P(e t | X t, e 0:t-1 ) P(X t | e 0:t-1 ) WHY? = α P(e t | X t ) P(X t | e 0:t-1 ) WHY? One step prediction of current state given evidence up to t-1 Inclusion of new evidence: this is available from..  So we only need to compute P(X t | e 0:t-1 ) A. Bayes Rule B. Cond. Independence C. Product Rule

CPSC 422, Lecture 14Slide 10

CPSC 422, Lecture 14Slide 11

Filtering  Compute P(X t | e 0:t-1 ) P(X t | e 0:t-1 ) = ∑ x t-1 P(X t, x t-1 |e 0:t-1 ) = ∑ x t-1 P(X t | x t-1, e 0:t-1 ) P( x t-1 | e 0:t-1 ) = = ∑ x t-1 P(X t | x t-1 ) P( x t-1 | e 0:t-1 ) because of..  Putting it all together, we have the desired recursive formulation P(X t | e 0:t ) = α P(e t | X t ) ∑ x t-1 P(X t | x t-1 ) P( x t-1 | e 0:t-1 )  P( X t-1 | e 0:t-1 ) can be seen as a message f 0:t-1 that is propagated forward along the sequence, modified by each transition and updated by each observation Filtering at time t-1 Inclusion of new evidence (sensor model)‏ Propagation to time t why? Filtering at time t-1 Transition model! Prove it?

Filtering P(X t | e 0:t ) = α P(e t | X t ) ∑ x t-1 P(X t | x t-1 ) P( x t-1 | e 0:t-1 )  Thus, the recursive definition of filtering at time t in terms of filtering at time t-1 can be expressed as a FORWARD procedure f 0:t = α FORWARD (f 0:t-1, e t )  which implements the update described in Filtering at time t-1 Inclusion of new evidence (sensor model) Propagation to time t

Analysis of Filtering  Because of the recursive definition in terms for the forward message, when all variables are discrete the time for each update is constant (i.e. independent of t )  The constant depends of course on the size of the state space

Rain Example Rain 0 Rain 1 Umbrella 1 Rain 2 Umbrella 2  Suppose our security guard came with a prior belief of 0.5 that it rained on day 0, just before the observation sequence started.  Without loss of generality, this can be modelled with a fictitious state R 0 with no associated observation and P(R 0 ) =  Day 1: umbrella appears (u 1 ). Thus P(R 1 | e 0:t-1 ) = P(R 1 ) = ∑ r 0 P(R 1 | r 0 ) P(r 0 ) = * * 0.5 = TRUE 0.5 FALSE R t-1 P(R t ) tftf RtRt P(U t ) tftf

Rain Example Rain 0 Rain 1 Umbrella 1 Rain 2 Umbrella 2  Updating this with evidence from for t =1 (umbrella appeared) gives P(R 1 | u 1 ) = α P(u 1 | R 1 ) P(R 1 ) = α = α ~  Day 2: umbella appears (u 2 ). Thus P(R 2 | e 0:t-1 ) = P(R 2 | u 1 ) = ∑ r 1 P(R 2 | r 1 ) P(r 1 | u 1 ) = = * * ~ TRUE 0.5 FALSE R t-1 P(R t ) tftf RtRt P(U t ) tftf

Rain Example Rain 0 Rain 1 Umbrella 1 Rain 2 Umbrella 2  Updating this with evidence from for t =2 (umbrella appeared) gives P(R 2 | u 1, u 2 ) = α P(u 2 | R 2 ) P(R 2 | u 1 ) = α = α ~  Intuitively, the probability of rain increases, because the umbrella appears twice in a row TRUE 0.5 FALSE

Practice exercise (home) Compute filtering at t 3 if the 3 rd observation/evidence is no umbrella (will put solution on inked slides) CPSC 422, Lecture 14Slide 18

CPSC 422, Lecture 1419 Lecture Overview Filtering (posterior distribution over the current state given evidence to date) From intuitive explanation to formal derivation Example Prediction ( posterior distribution over a future state given evidence to date ) (start) Smoothing (posterior distribution over a past state given all evidence to date)

Prediction P(X t+k+1 | e 0:t )  Can be seen as filtering without addition of new evidence  In fact, filtering already contains a one-step prediction P(X t | e 0:t ) = α P(e t | X t ) ∑ x t-1 P(X t | x t-1 ) P( x t-1 | e 0:t-1 ) Filtering at time t-1 Inclusion of new evidence (sensor model)‏ Propagation to time t  We need to show how to recursively predict the state at time t+k +1 from a prediction for state t + k P(X t+k+1 | e 0:t ) = ∑ x t+k P(X t+k+1, x t+k |e 0:t ) = ∑ x t+k P(X t+k+1 | x t+k, e 0:t ) P( x t+k | e 0:t ) = = ∑ x t+k P(X t+k+1 | x t+k ) P( x t+k | e 0:t )  Let‘s continue with the rain example and compute the probability of Rain on day four after having seen the umbrella in day one and two: P(R 4 | u 1, u 2 ) Prediction for state t+ k Transition model

Rain Example Rain 0 Rain 1 Umbrella 1 Rain 2 Umbrella 2  Prediction from day 2 to day 3 P(X 3 | e 1:2 ) = ∑ x 2 P(X 3 | x 2 ) P( x 2 | e 1:2 ) = ∑ r 2 P(R 3 | r 2 ) P( r 2 | u 1 u 2 ) = = * *0.117 = + = Rain 3 Umbrella  Prediction from day 3 to day 4 P(X 4 | e 1:2 ) = ∑ x 3 P(X 4 | x 3 ) P( x 3 | e 1:2 ) = ∑ r 3 P(R 4 | r 3 ) P( r 3 | u 1 u 2 ) = = * *0.347= + = Rain 3 Umbrella R t-1 P(R t ) tftf RtRt P(U t ) tftf

Rain Example  What happens if I try to predict further and further into the future? A. Probability of Rain will oscillate B. Probability of Rain will decrease indefinitely to zero C. Probability of Rain will converge to a specific value

Rain Example  Intuitively, the probability that it will rain decreases for each successive day, as the influence of the observations from the first two days decays  What happens if I try to predict further and further into the future? It can be shown that the predicted distribution converges to the stationary distribution of the Markov process defined by the transition model ( for the rain example)‏( When the convergence happens, I have basically lost all the information provided by the existing observations, and I can’t generate any meaningful prediction on states from this point on The time necessary to reach this point is called mixing time. The more uncertainty there is in the transition model, the shorter the mixing time will be Basically, the more uncertainty there is in what happens at t+1 given that I know what happens in t, the faster the information that I gain from evidence on the state at t dissipates with time

Inference Tasks in Temporal Models  Smoothing: P(X t-k | e 0:t ) Compute the posterior distribution over a past state given all evidence to date In the rain example, this would mean computing the probability that it rained five days ago given all the observations on umbrella made so far Useful to better estimate what happened by incorporating additional evidence to the evidence available at that time  Most Likely Explanation: argmax X 0:t P(X 0:t | e 0:t ) Given a sequence of observations, find the sequence of states that is most likely to have generated them Useful in many applications, e.g., speech recognition: find the most likely sequence of words given a sequence of sounds

CPSC 422, Lecture 1425 Lecture Overview Filtering (posterior distribution over the current state given evidence to date) From intuitive explanation to formal derivation Example Prediction ( posterior distribution over a future state given evidence to date ) (start) Smoothing (posterior distribution over a past state given all evidence to date)

Smoothing  Smoothing: Compute the posterior distribution over a past state given all evidence to date P(X k | e 0:t ) for 1 ≤ k < t E0E0

Smoothing  P(X k | e 0:t ) = P(X k | e 0:k,e k+1:t ) dividing up the evidence = α P(X k | e 0:k ) P(e k+1:t | X k, e 0:k ) using… = α P(X k | e 0:k ) P(e k+1:t | X k ) using… backward message, b k+1:t computed by a recursive process that runs backwards from t forward message from filtering up to state k, f 0:k

Smoothing  P(X k | e 0:t ) = P(X k | e 0:k,e k+1:t ) dividing up the evidence = α P(X k | e 0:k ) P(e k+1:t | X k, e 0:k ) using Bayes Rule = α P(X k | e 0:k ) P(e k+1:t | X k ) By Markov assumption on evidence backward message, b k+1:t computed by a recursive process that runs backwards from t forward message from filtering up to state k, f 0:k

CPSC 422, Lecture 14Slide 29 Learning Goals for today’s class  You can: Describe Filtering and derive it by manipulating probabilities Describe Prediction and derive it by manipulating probabilities Describe Smoothing and derive it by manipulating probabilities

CPSC 422, Lecture 14Slide 30 TODO for Fri Complete and submit Assignment-1 Assignment-2 will be posted on Fri RL, Approx. Inference in BN, Temporal Models – start working on it asap – due Feb 18 (it may take longer than first one) Reading Textbook Chp. 6.5