Introduction to Deep Probabilistic Programming with Pyro
柯維然 Odie
Outline
Probabilistic Programming
Deep learning
Bayesian learning
Graphical model
Logic/Rule based
Domain knowledge
Handcrafted features
Probabilistic Programming
Intuition
Program
Output / Sample
Program
Output
Program
Data / Observation
Probabilistic Programming
Sampling
Inference
Human-level concept learning through probabilistic program induction
Build, Compute, Critique, Repeat
Pyro
Temperature-Sensor Model
Sampling
Trace
model arguments
Evaluation probability
Evidence Lower Bound
Define the generative model
Define the guide model
Monte Carlo ELBO
Define the generative model
Define the guide model
Define model & guide
Obs is i.i.d !
SVI
Pyro implement several ELBO object function , will have lower variance
Use navie ELBO or custom implementation
Training & result
Posterior : temp ~ N(13,8661 , 0.1686)
Prior : temp ~ N(0 , 1)
Real data : temp ~ N(15 , 10)
Take home …
SVI
Model , Guide
Prior
Gaussian Mixture Model
Z
X
locs
Scales
Weight
N
plate
K
Define model
Marginalized discrete RV in SVI
MLE
Gaussian component prior
Define guide & training
Auto generate guide function for point estimation
Enumerate discrete RV
Result
K=16
K=8
Generate new data
K=16
K=8
Fix locs and scales from guide_trace , then resample x
Latent Dirichlet Allocation
Generate data
Sequential not vectorized
Define model
Define guide
mini batch training
Topic result
Variational Autoencoders
Unsupervised object detection
pos
B*H*W*N
logit
B*4*4*2
Yolo like model
Unsupervised object detection
Model definition
differential image render
Differential image render
Spatial transformer networks
Transform pos and logit
Result
use point estimation guide
use CNN guide and more object
Conclusion
Refernece & Resource
Q&A
Thanks for listening