sampling methods
play

Sampling Methods Henrik I. Christensen Robotics & Intelligent - PowerPoint PPT Presentation

Introduction Basic Algorithms Example Summary Sampling Methods Henrik I. Christensen Robotics & Intelligent Machines @ GT Georgia Institute of Technology, Atlanta, GA 30332-0280 hic@cc.gatech.edu Henrik I. Christensen (RIM@GT)


  1. Introduction Basic Algorithms Example Summary Sampling Methods Henrik I. Christensen Robotics & Intelligent Machines @ GT Georgia Institute of Technology, Atlanta, GA 30332-0280 hic@cc.gatech.edu Henrik I. Christensen (RIM@GT) Sampling Methods 1 / 23

  2. Introduction Basic Algorithms Example Summary Outline Introduction 1 Basic Algorithms 2 Small Robot Example 3 Summary 4 Henrik I. Christensen (RIM@GT) Sampling Methods 2 / 23

  3. Introduction Basic Algorithms Example Summary Introduction Last time we talked about approximation of distributions using deterministic approximation Not clear that it is always possible to generate such solutions. Might not be possible to generate an estimate of the distribution How can we find the distribution / expectation of a function wrt a probability distribution p(z)? I.e. can we evaluate � E [ f ] = f ( z ) p ( z ) dz Henrik I. Christensen (RIM@GT) Sampling Methods 3 / 23

  4. Introduction Basic Algorithms Example Summary Introduction The general idea with sampling Collect a set of samples z ( l ) from p ( z ) Evaluate L f = 1 ˆ � f ( z ( l ) ) L l =1 ˆ f is a good estimate of the mode/expectation and the variance of the estimator can be computed Main challenge - how can we generates samples from p ( z )? Henrik I. Christensen (RIM@GT) Sampling Methods 4 / 23

  5. Introduction Basic Algorithms Example Summary Introduction In some cases a graphical model is available From earlier (8.1.2) we have M � p ( z ) = p ( z i | pa i ) i =1 where pa i is the set of parents to a node i We can then sample the conditional distributions Do a pass through the tree and compute the distribution Henrik I. Christensen (RIM@GT) Sampling Methods 5 / 23

  6. Introduction Basic Algorithms Example Summary Outline Introduction 1 Basic Algorithms 2 Small Robot Example 3 Summary 4 Henrik I. Christensen (RIM@GT) Sampling Methods 6 / 23

  7. Introduction Basic Algorithms Example Summary Standard distributions It is common to generate pseudo random sequences using a standard random number generator If we want to transform the z according to a function f(.) so that y=f(z) we have � � dz � � p ( y ) = p ( z ) � � dy � � Integrating we have � y z = h ( y ) = p (ˆ y ) d ˆ y −∞ So we are after y = h − 1 ( z ) Henrik I. Christensen (RIM@GT) Sampling Methods 7 / 23

  8. Introduction Basic Algorithms Example Summary Standard Distributions Consider the standard exponential distribution p ( y ) = λ exp( − λ y ) Then h ( y ) = 1 − exp( λ y ) ⇒ y = − λ − 1 ln(1 − z ) Now the uniform z will have an exponential distribution Henrik I. Christensen (RIM@GT) Sampling Methods 8 / 23

  9. Introduction Basic Algorithms Example Summary Uniform Gaussian (in 2D) Consider a mapping f 1 ( z ) = 2 z − 1 Reject all values where z 2 1 + z 2 2 > 1 Assign p ( z 1 , z 2 ) = 1 /π This is a uniform distribution inside the unit circle Generate the mapping � 2 � − 2 ln z i y i = z i r 2 The joint distribution is then exp( − y 2 exp( − y 2 � 1 � � 1 � 1 2 p ( y 1 , y 2 ) = √ 2 ) √ 2 ) 2 π 2 π Henrik I. Christensen (RIM@GT) Sampling Methods 9 / 23

  10. Introduction Basic Algorithms Example Summary Standard Distributions Transformation depends upon the ability to calculate and then invert the indefinite integral Sometimes more general approaches are required for sampling Rejection Sampling 1 Important Sampling 2 Henrik I. Christensen (RIM@GT) Sampling Methods 10 / 23

  11. Introduction Basic Algorithms Example Summary Rejection Sampling Assume we have a distribution p(z) which is difficult to access, but we have a scaled version ˜ p ( z ) which is the same up to a scaling p ( z ) = 1 p ( z ) ˜ Z p We can propose a distribution q ( z ) We can then consider kq ( z ) ≥ ˜ p ( z ) Henrik I. Christensen (RIM@GT) Sampling Methods 11 / 23

  12. Introduction Basic Algorithms Example Summary Rejection Sampling - Idea kq ( z ) kq ( z 0 ) p ( z ) � u 0 z 0 z Henrik I. Christensen (RIM@GT) Sampling Methods 12 / 23

  13. Introduction Basic Algorithms Example Summary Rejection Sampling - Example 0.15 0.1 p ( z ) 0.05 0 0 10 20 30 z Henrik I. Christensen (RIM@GT) Sampling Methods 13 / 23

  14. Introduction Basic Algorithms Example Summary Rejection Sampling - Example 0.5 p ( z ) 0.25 0 −5 0 5 z Henrik I. Christensen (RIM@GT) Sampling Methods 14 / 23

  15. Introduction Basic Algorithms Example Summary Importance Sampling Assume we could generate a uniform tessellation of space We can now evaluate � p ( z ( l ) ) f ( z ( l ) ) E [ f ] ≈ l Assume we have a simpler distribution q(z) that is easier to sample � E [ f ] = f ( z ) p ( z ) dz � f ( z ) p ( z ) = q ( z ) q ( z ) dz p ( z ( l ) ) 1 � q ( z ( l ) ) f ( z ( l ) ) ≈ L l the ratio r = p ( z ) / q ( z ) is known as the importance weight We can normalize to have weights w i = r i / � r l Henrik I. Christensen (RIM@GT) Sampling Methods 15 / 23

  16. Introduction Basic Algorithms Example Summary Sampling Importance Resampling The sampling can be re-evaluated over time to avoid a uniform distribution of sampling up-front. I.e. we should sample more densely close major probability masses. Henrik I. Christensen (RIM@GT) Sampling Methods 16 / 23

  17. Introduction Basic Algorithms Example Summary Outline Introduction 1 Basic Algorithms 2 Small Robot Example 3 Summary 4 Henrik I. Christensen (RIM@GT) Sampling Methods 17 / 23

  18. Introduction Basic Algorithms Example Summary Monte-Carlo Based Localization Monte-Carlo based methods is using a sample model for approximation of the pose estimate Using a grid model as presented earlier Assume we have a number of particles in a collection � � ( s ( i ) t , π ( i ) S t = t ) | i = 1 .. N each particle is a hypothesis for the position of the robot, and π ( i ) is t an associated weight We can now approximate p ( s t | z 0 , z 1 , ... z t ) for any distribution of the pose hypotheses Henrik I. Christensen (RIM@GT) Sampling Methods 18 / 23

  19. Introduction Basic Algorithms Example Summary Monte-Carlo Strategy 1 Draw N samples from an initial PDF. Typically a uniform distribution. Give each sample a weight of 1 N 2 Propagate the motion information and draw a new sample from the distribution p ( s ( i ) t +1 | s ( i ) t , o t ) 3 Set the weight of the sample to π ( i ) t +1 = p ( z t +1 | s ( i ) t +1 ) ∗ π ( i ) based on t sensory input 4 Generate a new sample set by drawing samples from the current set and a basis distribution (typically uniform). Normalize the weights 5 Go back to step 2 Henrik I. Christensen (RIM@GT) Sampling Methods 19 / 23

  20. Introduction Basic Algorithms Example Summary Monte-Carlo Example Example of particle distribution around estimate of position Sonar readings for update of the position Video of system in operation Henrik I. Christensen (RIM@GT) Sampling Methods 20 / 23

  21. Introduction Basic Algorithms Example Summary Monte-Carlo Example Henrik I. Christensen (RIM@GT) Sampling Methods 21 / 23

  22. Introduction Basic Algorithms Example Summary Outline Introduction 1 Basic Algorithms 2 Small Robot Example 3 Summary 4 Henrik I. Christensen (RIM@GT) Sampling Methods 22 / 23

  23. Introduction Basic Algorithms Example Summary Summary Sampling based methods are efficient for many applications The key is typically in the sampling/re-sampling strategy There are quite a few ways sampling can be applied Next time we will cover the popular MCMC strategy Henrik I. Christensen (RIM@GT) Sampling Methods 23 / 23

Recommend


More recommend