factor’graphs’for’time’series’ structuredopmizaonbhiksha/courses/mlsp.fall... ·...

81
Factor Graphs for Time Series Structured Op5miza5on Class 23. 20 Nov 2014 Instructor: Gary Overe: 20 Nov 2014 11755/18979 1

Upload: others

Post on 22-Apr-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Factor  Graphs  for  Time  Series  Structured  Op5miza5on  

Class  23.  20  Nov  2014  Instructor:  Gary  Overe:  

20 Nov 2014 11755/18979 1

Page 2: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Machine  Learning  Context  

Source:  h:p://en.wikipedia.org/wiki/Machine_learning  

…according  to  infallible  Wikipedia!  

20 Nov 2014 11755/18979 2

Page 3: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Machine  Learning  Context  

Source:  h:p://en.wikipedia.org/wiki/Machine_learning  

…according  to  infallible  Wikipedia!  

20 Nov 2014 11755/18979 3

Page 4: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Where  we  are  exploring  today?  

Source:  h:p://en.wikipedia.org/wiki/Machine_learning  20 Nov 2014 11755/18979 4

Page 5: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

What  might  you  know  about  your  “signal(s)”?  

•  Gaussian  DistribuLon  •  Made  up  of  Independent  Components  •  Face-­‐like  •  Clustered  •  Sparse  •  Locally  Smooth  (or  should  be!)  

20  Nov  2014   11755/18979   5  

Page 6: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

What  might  you  know  about  your  “signal(s)”?  

•  Gaussian  DistribuLon  •  Made  up  of  Independent  Components  •  Face-­‐like  •  Clustered  •  Sparse  •  Locally  Smooth  (or  should  be!)  •  Choose  or  derive  your  constraints!  

20  Nov  2014   11755/18979   6  

Page 7: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

The  more  I  know  about  my  signal  (or  the  signal  I  am  trying  to  

es5mate)  the  more  constraints  I’m  able  to  reasonably  apply!  

20  Nov  2014   11755/18979   7  

Page 8: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

General  vs.  Domain  Specific  Constraints  

General  •  Gaussian  •  Independent  •  Smooth  •  Non-­‐NegaLve  •  Sparse  

Domain  Specific  •  N-­‐Gram  Speech  Model  (cat-­‐sat-­‐on-­‐the-­‐?-­‐>mat)  

•  Connectedness  (Hand-­‐connected-­‐to-­‐arm  etc.)  

•  BallisLc  Trajectory  PredicLon  

•  Vehicle  MoLon  Model  (cars-­‐go-­‐forward/backwards  not  sideways)  20 Nov 2014 11755/18979 8

Page 9: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Consider  the  following  ‘signal’  

We  want  to  know  the  posiLon  of  a  survey  vehicle  in  the  real  world.  Given  the  following  Lme-­‐series  informaLon:  •  GPS  locaLon  data  at  1Hz  (may  suffer  dropout)  •  Wheel  Encoder  Odometry  Measurements  every  2m  •  InerLal  Sensor  Measurements  (Gyroscope)  every  2m  •  Basic  Vehicle  Geometry  (wheel  base  width  etc.)  

20  Nov  2014   11755/18979   9  

Page 10: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Vehicle  Localiza5on  (Pose)  Es5ma5on  

20  Nov  2014   11755/18979   10  

X = (x, y, ✓)

•  GPS  •  Odometry  •  Gyroscope  •  Vehicle  MoLon  Constraints  

Page 11: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Use  case  :  Vehicle/Camera  Pose  for  Asset  Localiza5on  

20 Nov 2014 11755/18979 11

Page 12: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Kalman  Filter  :  Fail!  

20 Nov 2014 11755/18979 12

Page 13: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Kalman  Filter  

20 Nov 2014 11755/18979 13

Page 14: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Certainty  Over  Time  (Odo+GPS)  

20 Nov 2014 11755/18979 14

Credit:  “Factor  Graphs  and  GTSAM:  A  hands  on  introducLon”,  Frank  Dellaert  

Page 15: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Certainty  Over  Time  (Odo  only)  

20 Nov 2014 11755/18979 15

Credit:  “Factor  Graphs  and  GTSAM:  A  hands  on  introducLon”,  Frank  Dellaert  

Page 16: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Kalman  Filter  :  Fail!  

20 Nov 2014 11755/18979 16

Page 17: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Survey  Vehicle  :  Signal  Behavior  •  GPS  Suffers  Dropout,  Noise  and  DisconLnuiLes  

•  Odometry  is  very  robust  but  mulLple  paths  can  explain  a  given  odometry  

•  Gyroscope  is  has  a  high  precision  but  ‘driis’  •  Vehicles  travel  along  relaLvely  smooth  paths.  Normal  operaLon  excludes  lateral  (sideways)  moLon.  

•  These  constraints  suggest  a  structured  (graphical)  predicLon  approach.  

20  Nov  2014   11755/18979   17  

Page 18: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Structured  Predic5on  :  Factor  Graphs  

20 Nov 2014 11755/18979 18

Page 19: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Factor  Graphs  

20 Nov 2014 11755/18979 19

Values  –  what  we  want  to  esLmate  

Page 20: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Factor  Graphs  

20 Nov 2014 11755/18979 20

Values  –  what  we  want  to  esLmate  •  Vehicle  Pose  •  Error  Corrected  HDD  Reader  Output  •  Image  SegmentaLon  Label  •  Price  of  Apple  Stock  at  Lme  t  etc.  

Page 21: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Factor  Graphs  

20 Nov 2014 11755/18979 21

Values  –  what  we  want  to  esLmate  

Factor(s)  –  a  constraint  we  formulate  

•  Vehicle  Pose  •  Error  Corrected  HDD  Reader  Output  •  Image  SegmentaLon  Label  •  Price  of  Apple  Stock  at  Lme  t  etc.  

Page 22: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Factor  Graphs  

20 Nov 2014 11755/18979 22

Values  –  what  we  want  to  esLmate  

Factor(s)  –  a  constraint  we  formulate  •  Odometry  Constraint  •  Error  CorrecLng  Code  •  SegmentaLon  Prior  (Green  -­‐>  Trees)  •  Todays  stock  price  same  as  yesterday  

•  Vehicle  Pose  •  Error  Corrected  HDD  Reader  Output  •  Image  SegmentaLon  Label  •  Price  of  Apple  Stock  at  Lme  t  etc.  

Page 23: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Factor  Graphs  

20 Nov 2014 11755/18979 23

Page 24: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Factoriza5on  

20 Nov 2014 11755/18979 24

x4

x1 x2 x3

x5

f1

f2

f3

f4

f5

g(x1, x2, x3, x4, x5) = f1(x1, x4)f2(x1, x1)f3(x2, x4)f4(x2, x3)f5(x3, x5)

Page 25: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Example  Factoriza5on  :  Markov  Chain  

20  Nov  2014   11755/18979   25  

x1 x2 x3

p(x1, x2, x3) = p(x1)p(x2|x1)p(x3|x2)

Page 26: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Unifying  View  of…  

•  Markov  random  fields  •  Kalman  Filters  •  HMM’s  •  Parity  Codes  •  Bayesian  Networks  

20  Nov  2014   11755/18979   26  

Page 27: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Other  nota5ons  

20  Nov  2014   11755/18979   27  

Original  Factor  Graph  

Bayesian  Network   Markov  Random  Field  

Forney-­‐Style  Factor  Graph  

W  

U  X   Z  

Y  

W  

U  

X  

Z  

Y  

W  

U  

X   Z  

Y  

W  

U  

X  

Z  

Y  

p(u,w, x, y, z) = p(u)p(w)p(x|u,w)p(y|x)p(z|x)

Page 28: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Bipar5te  Graph  

20  Nov  2014   11755/18979   28  

Original  Factor  Graph  

BiparLte  View  

W  

U  X   Z  

Y  

W   U   X   Z  Y  Values  

Factors  

•  Factors  encapsulate  constraints  being  imposed  

•  Values  adjust  to  become  consistent  with  these  constraints  

•  Usually  achieved  via  “message  passing”/gradient  descent  methods.  

Page 29: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Op5miza5on  

•  Several  algorithms  are  used  •  Random  vs  “Best  Guess”  iniLalizaLon  •  Gauss-­‐Newton  Stepping  •  Levenberg-­‐Marquart  •  Message  Passing  Algorithms  •  Structure  dependent/exploiLng  opLmizaLon  strategies  –  ISAM2  (for  SLAM  problems)  

20  Nov  2014   11755/18979   29  

Page 30: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Op5miza5on  

•  IniLalize  values  to  a  ‘best  guess’/random  •  Iterate  Lll  convergence  – Factors  messages  Values  with  Error  – Values  messages  Factors  

20  Nov  2014   11755/18979   30  

X  X  =  7.85±0.5  

Page 31: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Op5miza5on  

•  IniLalize  values  to  a  ‘best  guess’/random  •  Iterate  Lll  convergence  – Factors  messages  Values  with  Error  – Values  messages  Factors  

20  Nov  2014   11755/18979   31  

X=0  X  =  7.85±0.5  

Page 32: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Op5miza5on  

•  IniLalize  values  to  a  ‘best  guess’/random  •  Iterate  Lll  convergence  – Factors  messages  Values  with  Error  – Values  messages  Factors  

20  Nov  2014   11755/18979   32  

X=5  X  =  7.85±0.5  

Page 33: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Op5miza5on  

•  IniLalize  values  to  a  ‘best  guess’/random  •  Iterate  Lll  convergence  – Factors  messages  Values  with  Error  – Values  messages  Factors  

20  Nov  2014   11755/18979   33  

X=7  X  =  7.85±0.5  

Page 34: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Op5miza5on  

•  IniLalize  values  to  a  ‘best  guess’/random  •  Iterate  Lll  convergence  – Factors  messages  Values  with  Error  – Values  messages  Factors  

20  Nov  2014   11755/18979   34  

X=7.5  X  =  7.85±0.5  

Page 35: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Op5miza5on  

•  IniLalize  values  to  a  ‘best  guess’/random  •  Iterate  Lll  convergence  – Factors  messages  Values  with  Error  – Values  messages  Factors  

20  Nov  2014   11755/18979   35  

X=  7.85  

X  =  7.85±0.5  

Page 36: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Op5miza5on,  Factoriza5on  and  Sparsity  

20  Nov  2014   11755/18979   36  

J = Measurement  Jacobian  

Page 37: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Op5miza5on,  Factoriza5on  and  Sparsity  

20  Nov  2014   11755/18979   37  

J = Measurement  Jacobian  

Page 38: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Op5miza5on,  Factoriza5on  and  Sparsity  

20  Nov  2014   11755/18979   38  

J = Measurement  Jacobian  

Page 39: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Vehicle  Pose  Es5ma5on  

39 20 Nov 2014 11755/18979

Page 40: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

GTSAM  

20 Nov 2014 11755/18979 40

•  Georgia  Tech  Smoothing  and  Mapping  •  State  of  the  Art  in  SLAM,  Bundle  Adjustment,  ICP  

Page 41: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

GTSAM  

20 Nov 2014 11755/18979 41

Credit:  “Factor  Graphs  and  GTSAM:  A  hands  on  introducLon”,  Frank  Dellaert  

Page 42: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

SLAM  versus  Localiza5on  

•  No  “landmarks”,  rather  just  GPS  readings  •  Odometry  is  modeled  via  similar  means  •  Vehicle  Model  is  far  more  constrained  in  comparison  to  a  typical  roboLc  agent  

Page 43: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

ARRB  Vehicle  Introduc5on  

•  GPS  @  1Hz  •  Gyroscope,  AcceleraLon,  Odometry  @  2.0meters  

–  2-­‐axis  gyro  and  2-­‐D  accel  leading  to  somewhat  under  constrained  problem  

•  Images  @  2.0-­‐5.0  meters  (unsynchronised  to  above)  •  Random  Noise  including  non-­‐real-­‐Lme  OS  errors  so  unrestrained  arbitrary  corrupLon  of  the  data  is  possible!  

43  

Page 44: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

ARRB  Vehicle  Introduc5on  

44

Page 45: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

ARRB  Vehicle  Introduc5on  

•  GPS  @  1Hz  •  Gyroscope,  AcceleraLon,  Odometry  @  2.0meters  

–  2-­‐axis  gyro  and  2-­‐D  accel  leading  to  somewhat  under  constrained  problem  

•  Images  @  2.0-­‐5.0  meters  (unsynchronised  to  above)  •  Random  Noise  including  non-­‐real-­‐Lme  OS  errors  so  unrestrained  arbitrary  corrupLon  of  the  data  is  possible!  

•  This  is  the  kind  of  great  research  problem  that  comes  about  on  the  back  of  greatly  incompetent  design!  

45  

Page 46: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS  Factor  

46

Page 47: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS  Factor  

47

Page 48: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS  Factor  

48

Page 49: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS  Factor  

49

Page 50: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS  Factor  

50

Page 51: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS  Factor  

51

Page 52: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS  Factor  

52

Page 53: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS  Factor  

53

Page 54: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS  Factor  

54

Page 55: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS  Factor  

55

Page 56: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS  Factor  

56 Once  you  have  defined  all  these  you  are  ready  to  code  your  Factor  in  GTSAM  

Page 57: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS  Discon5nuity  

57

Page 58: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  Vehicle  Model  Factor  

58

Page 59: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  Vehicle  Model  Factor  

59

PredicLon  with  binary  factor  requires  more  than  just  pose  informaLon.  Therefore  we  augment  P  with  addiLonal  variables  to  track;  Lme,  speed  and  steering  angle.  

Page 60: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  Vehicle  Model  Factor  

60

PredicLon  with  binary  factor  requires  more  than  just  pose  informaLon.  Therefore  we  augment  P  with  addiLonal  variables  to  track;  Lme,  speed  and  steering  angle.  

Page 61: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  Vehicle  Model  Factor  

61

PredicLon  with  binary  factor  requires  more  than  just  pose  informaLon.  Therefore  we  augment  P  with  addiLonal  variables  to  track;  Lme,  speed  and  steering  angle.  

Pose  PredicLon  Model  

Page 62: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  Vehicle  Model  Factor  

62

PredicLon  with  binary  factor  requires  more  than  just  pose  informaLon.  Therefore  we  augment  P  with  addiLonal  variables  to  track;  Lme,  speed  and  steering  angle.  

Pose  PredicLon  Model  

???  

Page 63: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  Vehicle  Model  Factor  

63

PredicLon  with  binary  factor  requires  more  than  just  pose  informaLon.  Therefore  we  augment  P  with  addiLonal  variables  to  track;  Lme,  speed  and  steering  angle.  

Damping  

Page 64: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  Vehicle  Model  Factor  

64

PredicLon  with  binary  factor  requires  more  than  just  pose  informaLon.  Therefore  we  augment  P  with  addiLonal  variables  to  track;  Lme,  speed  and  steering  angle.  

Page 65: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  Vehicle  Model  Factor  

65

PredicLon  with  binary  factor  requires  more  than  just  pose  informaLon.  Therefore  we  augment  P  with  addiLonal  variables  to  track  Lme,  speed  and  steering  angle.  

Page 66: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  Vehicle  Model  Factor  

66

PredicLon  with  binary  factor  requires  more  than  just  pose  informaLon.  Therefore  we  augment  P  with  addiLonal  variables  to  track;  Lme,  speed  and  steering  angle.  

Page 67: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS+Vehicle...  

67

Page 68: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS+Vehicle...  

68

Page 69: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS+Vehicle...  

69

Indeterminate  System  without  Lme  being  constrained.  

Page 70: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GPS+Vehicle+Time  

70

Page 71: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GyroOdo  Factor  (R)  

71

Page 72: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  GyroOdo  Factor  (R)  

72

Page 73: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Pose  Es5ma5on  :  Sta5onary  Factor  (S)  

73

Page 74: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Op5miza5on  

•  Levenberg-­‐Marquardt,  iSAM,  iSAM2,  others  •  IniLalizaLon  sensiLviLes  can  require  somewhat  complex  ‘rules  of  thumb’  to  avoid  undesired  minima  

•  Speed  can  be  an  issue  •  Without  ground  truth  data  or  manual  checking  its  always  possible  there  are  unpleasant  surprises  in  the  opLmized  output  

Page 75: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

From  imaginaLon  to  impact  

Results  :  “Poser”  

75

Page 76: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Results  :  “Poser”  -­‐  more  than  2  mile  dropout  

76

Page 77: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Results  :  “Poser”  -­‐  tested  on  >  40,000miles  

77

Page 78: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Results  :  “Poser”  -­‐  tested  on  >  40,000miles  

78

2  known  fail  cases  :(  

Page 79: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

GICP  :  Kinect  Sensor  

20 Nov 2014 11755/18979 79

h:ps://www.youtube.com/watch?v=TY99Y_I_egg  

Page 80: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Factor  Graphs  :  Round  Up  

80  

• Factor  Graphs  are  great  for  expressing  formally  defined  relaLonships  (e.g.  in  SLAM  we  ‘know’  how  GPS  posiLons  should  relate  to  real  world  locaLons)  

• Highly  General  Tool  –  but  its  useful  for  building  specific  models/capturing  prior  knowledge  you  can  formalize  

• Contrast  with  Neural  Networks  –  both  are  graphical  models  but  Neural  Networks  work  to  discover  the  unknown  (or  you  are  lazy)  relaLonships  as  opposed  to  known  ones.  

Page 81: Factor’Graphs’for’Time’Series’ StructuredOpmizaonbhiksha/courses/mlsp.fall... · Factor’Graphs’for’Time’Series’ StructuredOpmizaon Class%23.%20%Nov%2014% Instructor:%Gary%Overe:%

Resources  

81  

• GTSAM  -­‐  h:ps://collab.cc.gatech.edu/borg/download  

• “Factor  Graphs  and  GTSAM:  A  hands  on  introducLon”,  Frank  Dellaert  

• Michael  Kaess  –  GTSAM  contributor  now  at  CMU-­‐RI  (see  h:ps://www.ri.cmu.edu/video_view.html?video_id=129&menu_id=387)  

• G2O  –  an  alternaLve  library  for  similar  factor  graph  opLmizaLons  

• Dimple  –  Graphical  Modelling  Tool  h:p://dimple.probprog.org/