Programming with Estimates

  • View
    100

  • Download
    0

  • Category

    Science

Preview:

Citation preview

Programming with EstimatesJames Bornholt University of Washington

Kathryn McKinley Matthias Felleisen Shan Lu Steve Blackburn Michael Carbin Matthew Might Jason Mars Mary Hall John Davis Shan Shan Huang

Milind Kulkarni Armando Solar-Lezama Lingjia Tang James Bornholt Ben Wiedermann Sam Blackshear Alvin Cheung Ravi Chugh Cindy Rubio-Gonzalez Jean Yang

Dr. Dr. Dr. Dr. Dr. Dr. Dr. Dr. Dr. Dr.

Dr. Dr. Dr. Dr. Dr. Dr. Dr. Dr. Dr.

Programming with EstimatesJames Bornholt University of Washington

with: Todd Mytkowicz Kathryn S. McKinley Microsoft Research

Na Meng Virginia Tech

Adrian Sampson Cornell

Dan Grossman Luis Ceze University of Washington

59 mph

🏅🏅🏅🏅🏅

59 mph

GeoPoint Prev = Get(); Sleep(5); GeoPoint Curr = Get(); double Dist = Distance(Prev, Curr); double Speed = Dist / 5;

Uncertain<T>

59 mph 86% more accurate!

Uncertain<GeoPoint> Prev = Get(); Sleep(5); Uncertain<GeoPoint> Curr = Get(); Uncertain<double> Dist = Distance(Prev, Curr); Uncertain<double> Speed = Dist / 5;

5 mph

An abstraction for programming with estimates Automates complex statistics!

In the beginning…

We want to make programming with sensors easier.

We already have the cute name: Uncertain<T>.

Nah, this will never work.

Programming language support for probabilistic modeling

Probabilistic programming

Let’s build a recommendation system!

Paper 1 Paper 2 Paper 3 Paper 4Paper 1 Paper 2

Likes PL Likes Arch

P [Likes PL|Paper 1] = ...

P [Likes PL|Paper 2] = ...

P [Paper 3|Likes PL] = ...

paper1 = … likesPL = f(paper1, …) …

Applications

public class GeoCoordinate { public double Latitude; public double Longitude;

public double HorizontalAccuracy; }

106 apps that use GPS

1 app that reads HorizontalAccuracy

Uncertain<T>Programs are graphical models

A = Get() B = Get() C = Get() D = A / B E = D - C

-

C/

E

BA

D

X

Y

x y x+y

X+Y

x y

So long as the data sources are updated, we can get distributions for your code for free!

Uncertain<T>Conditionals in your code are great places to do inference

if (Speed > 4) Alert(“You rock!”);

4 mph

0 2 4 6 8 10Speed (mph)

Compute the probability that the condition is true, and use a hypothesis test to decide the branch

Borrow from medical science to provide fully automated inference

Uncertain<T> for machine learningNeural networks give only a single output

if (Sobel(p) > 0.1) EdgeFound();

36% false positives!

Single output0.1

0.00 0.05 0.10 0.15 0.20 0.25Value of Sobel operator

True value Single output0.1

0.00 0.05 0.10 0.15 0.20 0.25Value of Sobel operator

Uncertain<T> for machine learningNeural networks give only a single output

if (Sobel(p) > 0.1) EdgeFound();

36% false positives!

True value Single output0.1

0.00 0.05 0.10 0.15 0.20 0.25Value of Sobel operator

Uncertain<T> for machine learningNeural networks give only a single output

if (Sobel(p) > 0.1) EdgeFound();

36% false positives!

True value Single output0.1

0.00 0.05 0.10 0.15 0.20 0.25Value of Sobel operator

Uncertain<T> for machine learningNeural networks give only a single output

if (Sobel(p) > 0.1) EdgeFound();

36% false positives!

Done is better than good

We really need another case study for the paper.

I’ve been taking a machine learning class this semester…

MATLAB C#CSV

Done is better than good

We really need another case study for the paper.

I’ve been taking a machine learning class this semester…

MATLAB C#Python

R

CSVCSV

CSV

Done is better than good

We really need another case study for the paper.

I’ve been taking a machine learning class this semester…

MATLAB C#Python

PythonR

CSVCSV

CSV

CSVNaive Precision

Naive Recall

60%

80%

100%

0.5 0.6 0.7 0.8 0.9Conditional threshold

Prec

isio

n/R

ecal

l (%

)

Uncertain<T>PrecisionRecall

Neural networks make great examples

POPL’16

PLSE @ University of Washington

Recommended