cs 4110
play

CS 4110 Probabilistic Programming Probabilistic Programming It's - PowerPoint PPT Presentation

CS 4110 Probabilistic Programming Probabilistic Programming It's not about writing software. Probabilistic Programming Probabilistic programming is a tool for statistical modeling. OR A probabilistic programming language is a plain old


  1. CS 4110 Probabilistic Programming

  2. Probabilistic Programming It's not about writing software.

  3. Probabilistic Programming Probabilistic programming is a tool for statistical modeling. OR A probabilistic programming language is a plain old programming language with rand(3) and a suite of fancy analysis tools for understanding its probabilistic behavior.

  4. An Example Model Takes Takes Takes CS 4780 CS 4242 CS 4110 Cloud of Unknowing Paper 1 Paper 2 Paper 3 Relevant Relevant Relevant PL+stats PL stats

  5. A Model for Humans Interest Interest in Stats in PL Takes Takes Takes CS 4780 CS 4242 CS 4110

  6. A Model for Humans Interest Interest Busy? in Stats in PL Takes Takes Takes CS 4780 CS 4242 CS 4110

  7. A Model for Humans Interest Interest Interest Interest Busy? in Stats in PL in Stats in PL Paper 1 Paper 2 Paper 3 Takes Takes Takes Relevant Relevant Relevant CS 4780 CS 4242 CS 4110

  8. A Model for Humans Pr[ A NIPS | I stats ∧ B ] = 0 . 3 Pr[ A NIPS | I stats ∧ ¬ B ] = 0 . 8 Pr[ A NIPS |¬ I stats ] = 0 . 1 Whither … reuse? Pr[ A Dagstuhl | I stats ∧ I PL ] = 0 . 3 Pr[ A Dagstuhl | I stats ∧ I PL ∧ ¬ B ] = 0 . 8 Pr[ A Dagstuhl |¬ ( I stats ∨ I PL )] = 0 . 1 … R 1 ∼ I PL ∧ I stats Whither Whither R 2 ∼ I PL intermediate abstraction? R 3 ∼ I stats variables?

  9. Writing even this tiny model feels like drudgery. (and we haven’t even gotten to the hard part yet)

  10. • What and Why • The Basics and Examples • Applications • Current Problems

  11. webppl .org

  12. Our First Probabilistic Program var b = flip (0.5); b ? "yes" : "no"

  13. Enumeration var roll = function () { var die1 = randomInteger(6) + 1; var die2 = randomInteger(6) + 1; return die1 + die2; } Enumerate (roll)

  14. Our Basic Model in webppl

  15. Conditioning var roll = function () { var die1 = randomInteger(6) + 1; var die2 = randomInteger(6) + 1; if (!(die1 === 4 || die2 === 4)) { factor (-Infinity); } return die1 + die2; } Enumerate (roll)

  16. Conditioning on Observations // Discard any executions that // don’t sum to 10. var out = die1 + die2; if (out !== 10) { factor (-Infinity); } // Return the values on the dice. return [die1, die2];

  17. Recommending Papers // Require my class attendance. var att = attendance(i_pl, i_stats, busy); require(att.cs4110 && att.cs4242 && !att.cs4780); return relevance(i_pl, i_stats);

  18. Inference Algorithms Enumerate is the simplest possible inference strategy.

  19. • What and Why • The Basics and Examples • Applications • Current Problems

  20. TrueSkill Measure Transformer Semantics for Bayesian Machine Learning Johannes Borgstr¨ om Andrew D. Gordon Michael Greenberg James Margetson Jurgen Van Gael // prior distributions, the hypothesis let skill () = random ( Gaussian (10.0,20.0)) let Alice , Bob , Cyd = skill (), skill (), skill () // observe the evidence let performance player = random ( Gaussian ( player ,1.0)) observe ( performance Alice > performance Bob ) // Alice beats Bob observe ( performance Bob > performance Cyd ) // Bob beats Cyd observe ( performance Alice > performance Cyd ) // Alice beats Cyd // return the skills Alice , Bob , Cyd

  21. webppl Vision Demo

  22. Forest db.org

  23. • What and Why • The Basics and Examples • Applications • Current Research

  24. R2

  25. R2’s weakest preconditions var die1 = randomInteger(7) + 1; var die2 = randomInteger(7) + 1; // Discard any executions that // don’t sum to 10. var out = die1 + die2; wasted work! require (out === 10);

  26. R2’s weakest preconditions var die1 = randomInteger(7) + 1; var die2 = randomInteger(7) + 1; require ( (die1 == 3 && die2 == 7) || …); var out = die1 + die2; require (out === 10);

  27. R2’s weakest preconditions var die1 = randomInteger(7) + 1; var die2 = randomInteger(7) + 1; require ( (die1 == 3 && die2 == 7) || …); var out = die1 + die2;

  28. Probabilistic assertions: design goals Work on a messy, mainstream language (C and C++) E ffi ciently check statistical properties of the output We don’t care about conditioning

  29. assert e , p, c p e must hold with probability p at confidence c

  30. distribution extraction verification via symbolic execution statistical optimizations float obfuscated( float n) { ✓ return n + gaussian(0.0, 1000.0); } float average_salary( float* salaries) { total = 0.0; for ( int i = 0; i < COUNT; ++i) total += obfuscated(salaries[i]); avg = total / len (salaries); p_avg = ...; passert e, p, c } Bayesian network IR

  31. distribution extraction verification via symbolic execution statistical optimizations float obfuscated( float n) { ✓ return n + gaussian(0.0, 1000.0); } float average_salary( float* salaries) { total = 0.0; for ( int i = 0; i < COUNT; ++i) total += obfuscated(salaries[i]); avg = total / len (salaries); p_avg = ...; passert e, p, c } Bayesian network IR

  32. Distribution extraction: random draws are symbolic symbolic heap 4.2 a b = a + gaussian(0.0, 1.0) 4.2 a 4.2 + G 0,1 b

  33. a 4.2 b G 0,1 input: a = 4.2 b = gaussian(0.0, 1.0)

  34. a 4.2 b G 0,1 c input: a = 4.2 + b = gaussian(0.0, 1.0) c = a + b

  35. a 4.2 b G 0,1 c input: a = 4.2 + b = gaussian(0.0, 1.0) c = a + b d + d = c + b

  36. a input: a = 4.2 c 4.2 b = gaussian(0.0, 1.0) + c = a + b d + b d = c + b G 0,1

  37. a input: a = 4.2 c 4.2 b = gaussian(0.0, 1.0) + c = a + b d + b d = c + b if b > 0.5 G 0,1 e = 2.0 > else 0.5 e = 4.0 if then e 2.0 ? else 4.0

  38. a input: a = 4.2 c 4.2 b = gaussian(0.0, 1.0) + c = a + b d + b d = c + b if b > 0.5 G 0,1 e = 2.0 3.0 > else 0.5 e = 4.0 ≤ if passert e <= 3.0, then e 2.0 ? 0.9, 0.9 else 4.0

  39. distribution extraction verification via symbolic execution statistical optimizations float obfuscated( float n) { ✓ return n + gaussian(0.0, 1000.0); } float average_salary( float* salaries) { total = 0.0; for ( int i = 0; i < COUNT; ++i) total += obfuscated(salaries[i]); avg = total / len (salaries); p_avg = ...; passert e, p, c } Bayesian network IR

  40. X G ( σ 2 µ X ∼ , X ) X ∼ U ( a, b ) Y G ( σ 2 µ Y ∼ , Y ) Y = cX Z = X + Y ⇒ Y ∼ U ( ca, cb ) Z ⇒ G ( µ X ∼ + σ 2 µ Y , X + σ 2 Y ) statistical passert verifier property optimization X ∼ U ( a, b ) D Y ∼ X ≤ c ∼ X , . . . n , X , X 2 1 X X a ≤ c ≤ b = i Y i ✓ c − a 2 ) ◆ n ⇒ Y ∼ B , σ µ D n ( G D Y ∼ ⇒ b − a

  41. distribution extraction verification via symbolic execution statistical optimizations float obfuscated( float n) { ✓ return n + gaussian(0.0, 1000.0); } float average_salary( float* salaries) { total = 0.0; for ( int i = 0; i < COUNT; ++i) total += obfuscated(salaries[i]); avg = total / len (salaries); p_avg = ...; passert e, p, c } Bayesian network IR

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