Lirong Xia Approximate inference: Particle filter Tue, April 1, 2014.

Slides:



Advertisements
Similar presentations
Particle Filtering Sometimes |X| is too big to use exact inference
Advertisements

State Estimation and Kalman Filtering CS B659 Spring 2013 Kris Hauser.
HMM II: Parameter Estimation. Reminder: Hidden Markov Model Markov Chain transition probabilities: p(S i+1 = t|S i = s) = a st Emission probabilities:
Dynamic Bayesian Networks (DBNs)
Lirong Xia Hidden Markov Models Tue, March 28, 2014.
Hidden Markov Models Reading: Russell and Norvig, Chapter 15, Sections
Chapter 15 Probabilistic Reasoning over Time. Chapter 15, Sections 1-5 Outline Time and uncertainty Inference: ltering, prediction, smoothing Hidden Markov.
Advanced Artificial Intelligence
1 Reasoning Under Uncertainty Over Time CS 486/686: Introduction to Artificial Intelligence Fall 2013.
HMMs Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew.
GS 540 week 6. HMM basics Given a sequence, and state parameters: – Each possible path through the states has a certain probability of emitting the sequence.
Probabilistic reasoning over time So far, we’ve mostly dealt with episodic environments –One exception: games with multiple moves In particular, the Bayesian.
… Hidden Markov Models Markov assumption: Transition model:
10/28 Temporal Probabilistic Models. Temporal (Sequential) Process A temporal process is the evolution of system state over time Often the system state.
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.
Hidden Markov Model Special case of Dynamic Bayesian network Single (hidden) state variable Single (observed) observation variable Transition probability.
CS 188: Artificial Intelligence Spring 2007 Lecture 14: Bayes Nets III 3/1/2007 Srini Narayanan – ICSI and UC Berkeley.
11/14  Continuation of Time & Change in Probabilistic Reasoning Project 4 progress? Grade Anxiety? Make-up Class  On Monday?  On Wednesday?
CS 188: Artificial Intelligence Fall 2006 Lecture 17: Bayes Nets III 10/26/2006 Dan Klein – UC Berkeley.
Hidden Markov Models. Hidden Markov Model In some Markov processes, we may not be able to observe the states directly.
Announcements Homework 8 is out Final Contest (Optional)
CS 188: Artificial Intelligence Fall 2009 Lecture 19: Hidden Markov Models 11/3/2009 Dan Klein – UC Berkeley.
Particle Filtering. Sensors and Uncertainty Real world sensors are noisy and suffer from missing data (e.g., occlusions, GPS blackouts) Use sensor models.
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:
CSE 573: Artificial Intelligence Autumn 2012
Simultaneous Localization and Mapping Presented by Lihan He Apr. 21, 2006.
Recap: Reasoning Over Time  Stationary Markov models  Hidden Markov models X2X2 X1X1 X3X3 X4X4 rainsun X5X5 X2X2 E1E1 X1X1 X3X3 X4X4 E2E2 E3E3.
CS 188: Artificial Intelligence Fall 2008 Lecture 19: HMMs 11/4/2008 Dan Klein – UC Berkeley 1.
UIUC CS 498: Section EA Lecture #21 Reasoning in Artificial Intelligence Professor: Eyal Amir Fall Semester 2011 (Some slides from Kevin Murphy (UBC))
Dynamic Bayesian Networks and Particle Filtering COMPSCI 276 (chapter 15, Russel and Norvig) 2007.
Announcements  Project 3 will be posted ASAP: hunting ghosts with sonar.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
Bayes’ Nets: Sampling [These slides were created by Dan Klein and Pieter Abbeel for CS188 Intro to AI at UC Berkeley. All CS188 materials are available.
Processing Sequential Sensor Data The “John Krumm perspective” Thomas Plötz November 29 th, 2011.
Maximum a posteriori sequence estimation using Monte Carlo particle filters S. J. Godsill, A. Doucet, and M. West Annals of the Institute of Statistical.
CS 416 Artificial Intelligence Lecture 17 Reasoning over Time Chapter 15 Lecture 17 Reasoning over Time Chapter 15.
CSE 473: Artificial Intelligence Spring 2012 Reasoning about Uncertainty & Hidden Markov Models Daniel Weld Many slides adapted from Dan Klein, Stuart.
The famous “sprinkler” example (J. Pearl, Probabilistic Reasoning in Intelligent Systems, 1988)
CPSC 422, Lecture 11Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11 Oct, 2, 2015.
QUIZ!!  In HMMs...  T/F:... the emissions are hidden. FALSE  T/F:... observations are independent given no evidence. FALSE  T/F:... each variable X.
Probabilistic reasoning over time Ch. 15, 17. Probabilistic reasoning over time So far, we’ve mostly dealt with episodic environments –Exceptions: games.
1 Chapter 15 Probabilistic Reasoning over Time. 2 Outline Time and UncertaintyTime and Uncertainty Inference: Filtering, Prediction, SmoothingInference:
CPSC 422, Lecture 17Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 17 Oct, 19, 2015 Slide Sources D. Koller, Stanford CS - Probabilistic.
Bayes Nets & HMMs Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell,
CS Statistical Machine learning Lecture 25 Yuan (Alan) Qi Purdue CS Nov
Reasoning over Time  Often, we want to reason about a sequence of observations  Speech recognition  Robot localization  User attention  Medical monitoring.
CSE 473: Artificial Intelligence Spring 2012 Reasoning about Uncertainty & Hidden Markov Models Daniel Weld Many slides adapted from Dan Klein, Stuart.
CSE 573: Artificial Intelligence Autumn 2012 Particle Filters for Hidden Markov Models Daniel Weld Many slides adapted from Dan Klein, Stuart Russell,
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
CSE 473: Artificial Intelligence Spring 2012 Reasoning about Uncertainty & Hidden Markov Models Daniel Weld Many slides adapted from Dan Klein, Stuart.
CS 541: Artificial Intelligence Lecture VIII: Temporal Probability Models.
CS 541: Artificial Intelligence Lecture VIII: Temporal Probability Models.
HMM: Particle filters Lirong Xia. HMM: Particle filters Lirong Xia.
Probabilistic reasoning over time
CS 4/527: Artificial Intelligence
Probabilistic Reasoning Over Time
Introduction to particle filter
CAP 5636 – Advanced Artificial Intelligence
Introduction to particle filter
Instructors: Fei Fang (This Lecture) and Dave Touretzky
CS 188: Artificial Intelligence
Hidden Markov Models Markov chains not so useful for most agents
CS 188: Artificial Intelligence Fall 2008
Chapter14-cont..
Hidden Markov Models Lirong Xia.
Speech recognition, machine learning
HMM: Particle filters Lirong Xia. HMM: Particle filters Lirong Xia.
Probabilistic reasoning over time
Speech recognition, machine learning
Presentation transcript:

Lirong Xia Approximate inference: Particle filter Tue, April 1, 2014

Friday April 4 –Project 3 due –Project 4 (HMM) out 1 Reminder

Recap: Reasoning over Time 2 Markov models p(X 1 ) p(X|X -1 ) Hidden Markov models p(E|X) XEp rainumbrella0.9 rainno umbrella0.1 sunumbrella0.2 sunno umbrella0.8 Filtering: Given time t and evidences e 1,…,e t, compute p(X t |e 1:t )

Filtering algorithm 3 Notation –B(X t-1 )=p(X t-1 |e 1:t-1 ) –B’(X t )=p(X t |e 1:t-1 ) Each time step, we start with p(X t-1 | previous evidence): Elapse of time B’(X t )= Σ x t-1 p(X t |x t-1 )B(x t-1 ) Observe B(X t ) ∝ p(e t |X t )B’(X t ) Renormalize B(X t )

Prior Sampling (w/o evidences) 4 Given a Bayesian network (graph and CPTs) Generate values of random variables sequentially –According to an order compatible with the graph –In each step, generate the value of the top unvalued variable given previously generated values This sampling procedure is consistent Samples: +c, -s, +r, +w -c, +s, -r, +w

Rejection Sampling 5 We want p(C|+s) –Do prior sampling, but ignore (reject) samples which don’t have S=+s –It is also consistent for conditional probabilities (i.e., correct in the limit) Problem –If p(+s) is too small then many samples are wasted +c, -s, +r, +w +c, +s, +r, +w -c, +s, +r, -w +c, -s, +r, +w -c, -s, -r, +w

Likelihood Weighting 6 Step 1: sampling unvalued variables z (given evidences e) Step 2: fix the evidences Step 3: the generated samples have weight Likelihood weighting is consistent z: C, R e: S, W

Particle filtering Dynamic Bayesian networks Viterbi algorithm 7 Today

Particle Filtering 8 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 This is how robot localization works in practice

Representation: Particles 9 p(X) is now represented by 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 –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) (2,1)

Particle Filtering: Elapse Time 10 Each particle is moved by sampling its next position from the transition model x’= sample(p(X’|x)) –This is like prior sampling – samples’ frequencies reflect the transition probabilities –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 11 Slightly trickier: –Don’t do rejection sampling (why not?) –Likelihood weighting –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 12 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 (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 (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

Elapse of time B’(X t )= Σ x t-1 p(X t |x t-1 )B(x t-1 ) Observe B(X t ) ∝ p(e t |X t )B’(X t ) Renormalize B(x t ) sum up to 1 13 Forward algorithm vs. particle filtering Forward algorithm Particle filtering Elapse of time x--->x’ Observe w(x’)=p(e t |x) Resample resample N particles

Robot Localization 14 In robot localization: –We know the map, but not the robot’s position –Observations may be vectors of range finder readings –State space and readings are typically continuous (works basically like a very fine grid) and so we cannot store B(X) –Particle filtering is a main technique

Dynamic Bayes Nets (DBNs) 15 We want to track multiple variables over time, using multiple sources of evidence Idea: repeat a fixed Bayes net structure at each time Variables from time t can condition on those from t-1 DBNs with evidence at leaves are HMMs

Exact Inference in DBNs 16 Variable elimination applies to dynamic Bayes nets Procedure: “unroll” the network for T time steps, then eliminate variables until p(X t |e 1:t ) is computed Online belief updates: eliminate all variables from the previous time step; store factors for current time only

DBN Particle Filters 17 A particle is a complete sample for a time step Initialize: generate prior samples for the t=1 Bayes net –Example particle: G 1 a =(3,3) G 1 b =(5,3) Elapse time: sample a successor for each particle –Example successor: G 2 a =(2,3) G 2 b =(6,3) Observe: weight each entire sample by the likelihood of the evidence conditioned on the sample –Likelihood: p(E 1 a |G 1 a )*p(E 1 b |G 1 b ) Resample: select prior samples (tuples of values) in proportion to their likelihood

SLAM 18 SLAM = Simultaneous Localization And Mapping –We do not know the map or our location –Our belief state is over maps and positions! –Main techniques: Kalman filtering (Gaussian HMMs) particle methods

HMMs: MLE Queries 19 HMMs defined by: –States X –Observations E –Initial distribution: p(X 1 ) –Transitions: p(X|X -1 ) –Emissions: p(E|X) Query: most likely explanation:

State Path 20 Graph of states and transitions over time Each arc represents some transition x t-1 →x t Each arc has weight p(x t |x t-1 )p(e t |x t ) Each path is a sequence of states The product of weights on a path is the seq’s probability Forward algorithm –computing the sum of all paths Viterbi algorithm –computing the best paths X 1 X 2 … X N

Viterbi Algorithm 21

Example 22 XEp +r+u0.9 +r-u0.1 -r+u0.2 -r-u0.8