todd mytkowicz kathryn s mckinley
play

Todd Mytkowicz Kathryn S. McKinley Wikipedia Sensors Big data - PowerPoint PPT Presentation

Uncertain< T > A First-Order Type for Uncertain Data James Bornholt Supervisor: Steve Blackburn Todd Mytkowicz Kathryn S. McKinley Wikipedia Sensors Big data Sampson et al. Bishop hidden units z M w (1) w (2) MD KM x D y K inputs


  1. Uncertain< T > A First-Order Type for Uncertain Data James Bornholt Supervisor: Steve Blackburn

  2. Todd Mytkowicz Kathryn S. McKinley

  3. Wikipedia Sensors Big data Sampson et al. Bishop hidden units z M w (1) w (2) MD KM x D y K inputs outputs y 1 x 1 w (2) z 1 10 x 0 z 0 Approximate computing Machine learning uncertain data

  4. struct ¡Geocoordinate ¡{ ¡ ¡ ¡ ¡ ¡double ¡Latitude; ¡ ¡ ¡ ¡ ¡double ¡Longitude; ¡ } ¡ ¡ Geocoordinate ¡Loc ¡= ¡GetGPSLocation(); ¡ discrete type

  5. uncertain data + discrete type ??? =

  6. uncertain data + discrete type = who cares?

  7. uncertain data + discrete type = uncertainty bug

  8. uncertain data + discrete type = uncertainty bug errors that occur when applications pretend that uncertain data is certain

  9. treating estimates as facts struct ¡Geocoordinate ¡{ ¡ ¡ ¡double ¡Latitude; ¡ ¡ ¡double ¡Longitude; ¡ ¡ ¡ ¡double ¡HorizontalAccuracy; ¡ } ¡ 95% of apps ignore accuracy!

  10. computation compounds error

  11. computation compounds error Usain Bolt

  12. computation compounds error 100 80 Walking speed (km/h) 60 Usain Bolt 40 20 0 Time

  13. false positives in questions if ¡(Speed ¡> ¡60) ¡ ¡IssueSpeedingTicket(); ¡ 60 km/h s = 75 km/h Speed 0 30 60 90 120 Speed (km/h)

  14. uncertainty bugs Treating estimates as facts Computation compounds error False positives in questions Caused by poor programming language abstractions Uncertainty should not be abstracted away

  15. related work Flexible Simple Developer computations Uncertain data Sensors, measurements, probabilistic models

  16. related work Flexible Simple Developer computations No Current abstraction abstractions Uncertain data Sensors, measurements, probabilistic models

  17. related work Flexible Simple Developer computations No Probabilistic Current abstraction programming abstractions Uncertain data Sensors, measurements, probabilistic models

  18. probabilistic programming Reasoning about probabilistic models earthquake ¡= ¡ Bernoulli (0.0001) ¡ burglary ¡ ¡ ¡= ¡ Bernoulli (0.001) ¡ alarm ¡ ¡ ¡ ¡ ¡ ¡= ¡earthquake ¡ or ¡burglary ¡ ¡ if ¡(earthquake) ¡ ¡ ¡phoneWorking ¡= ¡ Bernoulli (0.7) ¡ else ¡ ¡ ¡phoneWorking ¡= ¡ Bernoulli (0.99) ¡

  19. inference earthquake ¡= ¡ Bernoulli (0.0001) ¡ burglary ¡ ¡ ¡= ¡ Bernoulli (0.001) ¡ alarm ¡ ¡ ¡ ¡ ¡ ¡= ¡earthquake ¡ or ¡burglary ¡ if ¡(earthquake) ¡ ¡ ¡phoneWorking ¡= ¡ Bernoulli (0.7) ¡ else ¡ ¡ ¡phoneWorking ¡= ¡ Bernoulli (0.99) ¡ ¡ observe(alarm=true) ¡ query(phoneWorking) ¡ What is Pr[phoneWorking= v | alarm=True], for each possible value of v (i.e. True and False)?

  20. inference is expensive Some paths of execution are very unlikely 150 Pr[earthquake] ● 0.01 Time to query (sec) 0.0001 100 50 ● ● ● ● ● 0 100 200 300 400 500 Number of samples

  21. related work Flexible Simple Developer computations No Probabilistic Current abstraction programming abstractions Probabilistic data Sensors, measurements, probabilistic models

  22. related work Flexible Simple Developer computations No Probabilistic Current Uncertain<T> abstraction programming abstractions Probabilistic data Sensors, measurements, probabilistic models

  23. Uncertain<T> is an uncertain type abstraction. Encapsulates distributions, like prior work. But focuses on an accessible interface. For everyday programmers, Uncertain<T> enables programs that are more concise, expressive, and correct.

  24. using Uncertain<T> Identify the distribution Compute with the distribution Ask questions using conditionals Improve the quality of estimates

  25. identify compute question improve identifying the distribution Many library programmers already know the distribution they need to return!

  26. identify compute question improve identifying the distribution Many library programmers already know the distribution they need to return! “Get the estimated accuracy of this location, in meters. We define accuracy as the radius of 68% confidence. […] In statistical terms, it is assumed that location errors are random with a normal distribution.” —Android

  27. identify compute question improve representing distributions − ( x − µ ) 2 ⇢ � 1 Norm( x ; µ, σ ) = 2 πσ exp √ 2 σ 2

  28. identify compute question improve representing distributions Store probability density functions? − ( x − µ ) 2 ⇢ � 1 Norm( x ; µ, σ ) = 2 πσ exp √ 2 σ 2 Two problems: 1. Even simple operations are complex: Z ∞ f X + Y ( z ) = f Y ( z − x ) f X ( x ) d x −∞ 2. Many interesting distributions don’t have PDFs

  29. identify compute question improve representing distributions Store probability density functions? − ( x − µ ) 2 ⇢ � 1 Norm( x ; µ, σ ) = 2 πσ exp √ 2 σ 2 Two problems: 1. Even simple operations are complex: Z ∞ f X + Y ( z ) = f Y ( z − x ) f X ( x ) d x −∞ 2. Many interesting distributions don’t have PDFs

  30. identify compute question improve representing distributions Random sampling: two birds with one stone Simple operations are simple (e.g., +) More distributions can be represented Later: how to implement random sampling

  31. identify compute question improve computing with distributions Propagating uncertainty through calculations automatically with operator overloading A key advantage of random sampling: computation is simply* lifting of the original operators

  32. identify compute question improve computing with distributions Propagating uncertainty through calculations automatically with operator overloading A key advantage of random sampling: computation is simply* lifting of the original operators X If x a sample of X Y X+Y and y a sample of Y then x+y a sample of X+Y

  33. identify compute question improve computing with distributions * The caveat is that this only works if the operands are independent If not, we need to know something about how the variables are related This is an issue for all probabilistic programming

  34. identify compute question improve induced dependencies (X,Y independent) A ¡= ¡X ¡+ ¡Y ¡ B ¡= ¡A ¡+ ¡X ¡

  35. identify compute question improve induced dependencies We can distinguish inherent dependencies from programmer-induced dependencies (X,Y independent) A ¡= ¡X ¡+ ¡Y ¡ B ¡= ¡A ¡+ ¡X ¡ When evaluating B, both operands depend on X, so they are not independent Lazy evaluation to the rescue!

  36. identify compute question improve induced dependencies We can distinguish inherent dependencies from programmer-induced dependencies (X,Y independent) A ¡= ¡X ¡+ ¡Y ¡ B ¡= ¡A ¡+ ¡X ¡ When evaluating B, both operands depend on X, so they are not independent Lazy evaluation to the rescue!

  37. identify compute question improve asking questions if ¡(Speed ¡> ¡60) ¡ ¡IssueSpeedingTicket(); ¡ 60 km/h s = 75 km/h Speed 0 30 60 90 120 Speed (km/h)

  38. identify compute question improve comparing means if ¡( Speed.E() ¡> ¡60) ¡ ¡IssueSpeedingTicket(); ¡ E[Speed] 60 km/h 0 30 60 90 120 Speed (km/h)

  39. identify compute question improve comparing evidence if ¡( (Speed ¡> ¡60).E() ¡> ¡0.95 ) ¡ ¡IssueSpeedingTicket(); ¡ 60 km/h Pr[Speed > 60] 0 30 60 90 120 Speed (km/h)

  40. identify compute question improve comparing evidence > is a lifted operator if ¡( (Speed ¡> ¡60).E() ¡> ¡0.95 ) ¡ ¡IssueSpeedingTicket(); ¡ 60 km/h Pr[Speed > 60] 0 30 60 90 120 Speed (km/h)

  41. identify compute question improve comparing evidence type Uncertain<bool> if ¡( (Speed ¡> ¡60).E() ¡> ¡0.95 ) ¡ ¡IssueSpeedingTicket(); ¡ 60 km/h Pr[Speed > 60] 0 30 60 90 120 Speed (km/h)

  42. identify compute question improve comparing evidence mean of Uncertain<bool> if ¡( (Speed ¡> ¡60).E() ¡> ¡0.95 ) ¡ ¡IssueSpeedingTicket(); ¡ 60 km/h Pr[Speed > 60] 0 30 60 90 120 Speed (km/h)

  43. identify compute question improve comparing evidence = number in [0,1] if ¡( (Speed ¡> ¡60).E() ¡> ¡0.95 ) ¡ ¡IssueSpeedingTicket(); ¡ 60 km/h Pr[Speed > 60] 0 30 60 90 120 Speed (km/h)

  44. identify compute question improve comparing evidence % of True instances if ¡( (Speed ¡> ¡60).E() ¡> ¡0.95 ) ¡ ¡IssueSpeedingTicket(); ¡ 60 km/h Pr[Speed > 60] 0 30 60 90 120 Speed (km/h)

  45. identify compute question improve comparing evidence is there a >95% chance that Speed > 60? if ¡( (Speed ¡> ¡60).E() ¡> ¡0.95 ) ¡ ¡IssueSpeedingTicket(); ¡ 60 km/h Pr[Speed > 60] 0 30 60 90 120 Speed (km/h)

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