fine grained semantics for probabilistic programs
play

Fine-Grained Semantics for Probabilistic Programs Benjamin Timon - PowerPoint PPT Presentation

Fine-Grained Semantics for Probabilistic Programs Benjamin Timon Martin Bichsel Gehr Vechev Probabilistic models Security Networking Machine Learning Robotics Randomized Algorithms Probabilistic programming Probability density


  1. Fine-Grained Semantics for Probabilistic Programs Benjamin Timon Martin Bichsel Gehr Vechev

  2. Probabilistic models Security Networking Machine Learning Robotics Randomized Algorithms

  3. Probabilistic programming Probability density function Cumulative distribution function x := uniform (0,1); y := uniform (0,1); return x+y;

  4. Observations Probability density function Cumulative distribution function 0.5 x := uniform (0,1); y := uniform (0,1); observe (x+y>=1); return x+y;

  5. Partial functions Probability density function Cumulative distribution function 0.5 x := uniform (-1,1); x = sqrt (x); return x;

  6. start Loops 1/2 1/2 1/2 return 0 0 2 4 1 3 x := 2; 1 while x>0 { if x<4 { 1/2 1/2 1/2 if flip (0.5) { x++; } else { 0.5 x--; } } } return x;

  7. Interaction of exceptions x := 0; while 1 { x = x/x; } return x; Better:

  8. Interaction of exceptions II x := 0; while x==0 { x = flip (0.5); observe (x==0); } return x; Better:

  9. Interaction of exceptions III x := 10; d := gauss (0,1); observe (d>=-0.5); while x>=0 { x-=d; Better: } return x;

  10. Existing denotational semantics

  11. Our work – Denotational semantics Explicitly distinguish exceptions: • non-termination ( ) • errors ( ) • observation failure ( ) Our semantics also support • Mixing continuous and discrete distributions • Arrays • The score primitive

  12. Benefits • Deeper understanding of probabilistic semantics • Establish correctness of probabilistic solvers (e.g. PSI) • More efficient normalization in probabilistic solvers • Generalize to arbitrary number of exceptions

  13. Measure theory 1 0

  14. Measure theory 1 0

  15. Denotational semantics x := uniform (-1,1); x = sqrt (x); sqrt ( uniform (-1,1)) return x; lift lift lift lift

  16. Denotational semantics - Constants sqrt ( uniform (-1,1))

  17. Denotational semantics - Constants sqrt ( uniform (-1,1))

  18. Denotational semantics - Constants sqrt ( uniform (-1,1)) Dirac delta

  19. Denotational semantics - Constants sqrt ( uniform (-1,1))

  20. Denotational semantics - Functions sqrt ( uniform (-1,1))

  21. Denotational semantics - Functions sqrt ( uniform (-1,1))

  22. Denotational semantics - Functions sqrt ( uniform (-1,1))

  23. Denotational semantics - Functions sqrt ( uniform (-1,1))

  24. Denotational semantics - Functions sqrt ( uniform (-1,1))

  25. Denotational semantics - Composition sqrt ( uniform (-1,1))

  26. Denotational semantics - Loops n := 0; while ! flip (0.5) { n++; }

  27. Denotational semantics - Loops n := 0; while ! flip (0.5) { n++; }

  28. Denotational semantics - Loops n := 0; while ! flip (0.5) { n++; }

  29. Denotational semantics - Loops n := 0; while ! flip (0.5) { n++; }

  30. Probability kernel Theorem : The semantics of each expression and each statement is a probability kernel .

  31. Properties of Semantics - Commutativity F() { while 1 { skip ; } return 0; }

  32. Properties of Semantics - Associativity Proof : Relies on associativity of the product of kernels and composition of kernels.

  33. Score primitive x := gauss (0,1); score ( ); return x;

  34. Score primitive vs non-termination i := 0; while 1 { if i==0 { score (2); } else { score (0.5); } i = 1-i; }

  35. Score primitive – s-finite kernels Theorem : After adding the score primitive and abolishing non- termination, the semantics of each expression and each statement is an s-finite kernel . Informally:

  36. Features of probabilistic programming languages non-determinism mix discrete and continuous score observations loops recursion higher-order errors

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend