lirong xia approximate inference: particle filter tue, april 1, 2014

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

If you can't read please download the document

Upload: jack-waters

Post on 17-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

  • Slide 1
  • Lirong Xia Approximate inference: Particle filter Tue, April 1, 2014
  • Slide 2
  • Friday April 4 Project 3 due Project 4 (HMM) out 1 Reminder
  • Slide 3
  • 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 )
  • Slide 4
  • 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 )
  • Slide 5
  • 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
  • Slide 6
  • Rejection Sampling 5 We want p(C|+s) Do prior sampling, but ignore (reject) samples which dont 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
  • Slide 7
  • 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
  • Slide 8
  • Particle filtering Dynamic Bayesian networks Viterbi algorithm 7 Today
  • Slide 9
  • 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
  • Slide 10
  • Representation: Particles 9 p(X) is now represented by a list of N particles (samples) Generally, N
  • 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
  • Slide 15
  • Robot Localization 14 In robot localization: We know the map, but not the robots 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
  • Slide 16
  • 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
  • Slide 17
  • 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
  • Slide 18
  • 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
  • Slide 19
  • 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 http://www.cs.duke.edu/~parr/dpslam/D-Wing.html
  • Slide 20
  • 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:
  • Slide 21
  • 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 seqs probability Forward algorithm computing the sum of all paths Viterbi algorithm computing the best paths X 1 X 2 X N
  • Slide 22
  • Viterbi Algorithm 21
  • Slide 23
  • Example 22 XEp +r+u0.9 +r-u0.1 -r+u0.2 -r-u0.8