Embedded probabilistic programming
Oleg Kiselyov
FNMOC
- leg@pobox.com
Chung-chieh Shan
Rutgers University ccshan@cs.rutgers.edu
Embedded probabilistic programming Oleg Kiselyov Chung-chieh Shan - - PowerPoint PPT Presentation
Embedded probabilistic programming Oleg Kiselyov Chung-chieh Shan FNMOC Rutgers University oleg@pobox.com ccshan@cs.rutgers.edu 17 July 2009 Probabilistic inference Model (what) Inference (how) Prt
FNMOC
Rutgers University ccshan@cs.rutgers.edu
2/14
✾ ❂ ❀ Pr✭❘❡❛❧✐t② ❥ ❖❜s ❂ ♦❜s✮
2/14
✾ ❂ ❀ Pr✭❘❡❛❧✐t② ❥ ❖❜s ❂ ♦❜s✮
2/14
(BNT, PFP)
(BLOG, IBAL, Church)
2/14
(BNT, PFP)
(BLOG, IBAL, Church)
2/14
(BNT, PFP)
(BLOG, IBAL, Church)
2/14
(BNT, PFP)
(BLOG, IBAL, Church)
3/14
4/14
0.7 0.7 0.4 0.4 0.4 0.4 0.4 0.4 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
4/14
0.7 0.7 0.4 0.4 0.4 0.4 0.4 0.4 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
6/7 1/7
5/7 2/7
4/7 3/7
3/7 4/7
2/7 5/7
1/7 6/7
1 1
4/14
0.7 0.7 0.4 0.4 0.4 0.4 0.4 0.4 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
6/7 1/7
5/7 2/7
4/7 3/7
3/7 4/7
2/7 5/7
1/7 6/7
1 1 1/8
4/14
0.7 0.7 0.4 0.4 0.4 0.4 0.4 0.4 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
6/7 1/7
5/7 2/7
4/7 3/7
3/7 4/7
2/7 5/7
1/7 6/7
1 1
1/8 0.3 0.4 0.3 0.3
3/7
4/14
0.7 0.7 0.4 0.4 0.4 0.4 0.4 0.4 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
6/7 1/7
5/7 2/7
4/7 3/7
3/7 4/7
2/7 5/7
1/7 6/7
1 1 1/8
4/14
4/14
4/14
4/14
4/14
5/14
◮ Rich libraries: lists, arrays, database access, I/O, . . . ◮ Type inference ◮ Functions as first-class values ◮ Compiler ◮ Debugger ◮ Memoization
6/14
6/14
6/14
7/14
7/14
7/14
7/14
7/14
7/14
8/14
9/14
✳✽ ✳✷ ✳✸
✳✷ . . . ✳✻ . . . ✳✸ ✳✺ Exact inference by depth-first brute-force enumeration. Rejection sampling by top-down random traversal.
9/14
✳✽
✳✷ ✳✸
✳✷
✳✻
✳✸ ✳✺ Exact inference by depth-first brute-force enumeration. Rejection sampling by top-down random traversal.
9/14
✳✽
✳✷ ✳✸
✳✷
✳✻
✳✸ ✳✺ Exact inference by depth-first brute-force enumeration. Rejection sampling by top-down random traversal.
9/14
✳✽
✳✷ ✳✸
✳✷ closed
✳✻
✳✸ ✳✺ Exact inference by depth-first brute-force enumeration. Rejection sampling by top-down random traversal.
9/14
✳✽ closed ✳✷ ✳✸
✳✷ closed
✳✻
✳✸ ✳✺ Exact inference by depth-first brute-force enumeration. Rejection sampling by top-down random traversal.
9/14
✳✽ closed ✳✷ ✳✸
✳✷ closed
✳✻
✳✸ ✳✺
◮ Brute-force enumeration becomes bucket elimination ◮ Sampling becomes particle filtering
9/14
✳✽ closed ✳✷ ✳✸
✳✷ closed
✳✻
✳✸ ✳✺
◮ represent a probability and state monad
◮ using first-class delimited continuations
9/14
✳✽ closed ✳✷ ✳✸
✳✷ closed
✳✻
✳✸ ✳✺
9/14
✳✽ closed ✳✷ ✳✸
✳✷ closed
✳✻
✳✸ ✳✺
◮ Model runs inside a thread. ◮ dist clones the thread. ◮ fail kills the thread. ◮ Memoization mutates thread-local storage.
10/14
✳✽
✳✷ ✳✸
✳✷
✳✻
✳✸ ✳✺ Probability mass ♣❝ ❂ ✶
10/14
✳✽
✳✷ ✳✸
✳✷
✳✻
✳✸ ✳✺ Probability mass ♣❝ ❂ ✶
10/14
✳✽
✳✷ ✳✸
✳✷
✳✻
✳✸ ✳✺ Probability mass ♣❝ ❂ ✶
10/14
✳✽
✳✷ ✳✸
✳✷
✳✻
✳✸ ✳✺ Probability mass ♣❝ ❂ ✿✼✺
10/14
✳✽
✳✷ ✳✸
✳✷ closed
✳✻
✳✸ ✳✺ Probability mass ♣❝ ❂ ✿✼✺
10/14
✳✽
✳✷ ✳✸
✳✷ closed
✳✻
✳✸ ✳✺ Probability mass ♣❝ ❂ ✿✼✺
10/14
✳✽
✳✷ ✳✸
✳✷ closed
✳✻
✳✸ ✳✺ Probability mass ♣❝ ❂ ✵
10/14
✳✽ closed ✳✷ ✳✸
✳✷ closed
✳✻
✳✸ ✳✺ Probability mass ♣❝ ❂ ✵
11/14
12/14
(Pfeffer 2007)
12/14
(Pfeffer 2007)
12/14
(Pfeffer 2007)
12/14
(Pfeffer 2007)
12/14
(Pfeffer 2007)
12/14
(Pfeffer 2007)
12/14
(Pfeffer 2007)
5 10 15 20 25 30 35 40
Frequency in 100 trials ln Pr(D = 1 | S = 1) IBAL 90 seconds 30 seconds
13/14
(Milch et al. 2007)
13/14
(Milch et al. 2007)
13/14
(Milch et al. 2007)
13/14
(Milch et al. 2007)
14/14
(BNT, PFP)
(BLOG, IBAL, Church)