Programming the Internet of Uncertain <T>hings James Bornholt - - PowerPoint PPT Presentation

programming the internet of uncertain t hings
SMART_READER_LITE
LIVE PREVIEW

Programming the Internet of Uncertain <T>hings James Bornholt - - PowerPoint PPT Presentation

Programming the Internet of Uncertain <T>hings James Bornholt University of Washington Na Meng University of Texas at Austin Todd Mytkowicz Microsoft Research Kathryn S. McKinley Microsoft Research 1 2 24 mph 2 3 GeoCoordinate


slide-1
SLIDE 1

1

Programming the Internet of Uncertain <T>hings

James Bornholt Na Meng Todd Mytkowicz Kathryn S. McKinley

University of Washington University of Texas at Austin Microsoft Research Microsoft Research

slide-2
SLIDE 2

2

slide-3
SLIDE 3

2

24 mph

slide-4
SLIDE 4

3

slide-5
SLIDE 5

4

GeoCoordinate PrevLocn = Get(); Sleep(5); GeoCoordinate Location = Get();

slide-6
SLIDE 6

5

GeoCoordinate PrevLocn = Get(); Sleep(5); GeoCoordinate Location = Get(); double Dist = Distance(LastLocn, Location); double Speed = Dist / 5;

slide-7
SLIDE 7

6

GeoCoordinate PrevLocn = Get(); Sleep(5); GeoCoordinate Location = Get(); double Dist = Distance(LastLocn, Location); double Speed = Dist / 5; if (Speed > 4) Alert("Keep it up!");

slide-8
SLIDE 8

7

slide-9
SLIDE 9

7

59 mph

slide-10
SLIDE 10

8

slide-11
SLIDE 11

8

sensors machine learning

slide-12
SLIDE 12

9

sensors machine learning

slide-13
SLIDE 13

9

sensors machine learning approximate computing

slide-14
SLIDE 14

10

Uncertain<T> exploiting context

an abstraction for reasoning about noise [ASPLOS’14] language constructs to make data more accurate

slide-15
SLIDE 15

10

Uncertain<T> exploiting context

an abstraction for reasoning about noise [ASPLOS’14] language constructs to make data more accurate

slide-16
SLIDE 16

11

GeoCoordinate PrevLocn = Get(); Sleep(5); GeoCoordinate Location = Get(); double Dist = Distance(LastLocn, Location); double Speed = Dist / 5; if (Speed > 4) Alert("Keep it up!");

slide-17
SLIDE 17

12

Uncertain<GeoCoordinate> PrevLocn = Get(); Sleep(5); Uncertain<GeoCoordinate> Location = Get(); Uncertain<double> Dist = Distance(LastLocn, Location); Uncertain<double> Speed = Dist / 5; if (Speed > 4) Alert("Keep it up!");

slide-18
SLIDE 18

12

Uncertain<GeoCoordinate> PrevLocn = Get(); Sleep(5); Uncertain<GeoCoordinate> Location = Get(); Uncertain<double> Dist = Distance(LastLocn, Location); Uncertain<double> Speed = Dist / 5; if (Speed > 4) Alert("Keep it up!"); 8 6 % f e w e r e r r

  • r

s

slide-19
SLIDE 19

Semantics

Uncertain<T> encapsulates probability distributions and hides statistical complexity.

  • Computing over random variables
  • Deciding conditionals

13

slide-20
SLIDE 20

Computations

14

X Y X+Y Represent distributions by random samples

slide-21
SLIDE 21

Computations

14

X Y x y X+Y x y Represent distributions by random samples

slide-22
SLIDE 22

Computations

14

X Y x y x+y X+Y x y Represent distributions by random samples

slide-23
SLIDE 23

Operators build a Bayesian network rather than evaluating immediately.

Computations

15

D = A / B

A B

slide-24
SLIDE 24

Operators build a Bayesian network rather than evaluating immediately.

Computations

15

D = A / B

A B / D

slide-25
SLIDE 25

Operators build a Bayesian network rather than evaluating immediately.

Computations

15

D = A / B E = D - C

A B / C D

slide-26
SLIDE 26

Operators build a Bayesian network rather than evaluating immediately.

Computations

15

D = A / B E = D - C

A B / C – D E

slide-27
SLIDE 27

Deciding conditionals

if (Speed > 4) Alert("Keep it up!");

16

4 mph

2 4 6 8 10

Speed (mph)

slide-28
SLIDE 28

Deciding conditionals

if (Speed > 4) Alert("Keep it up!");

17

4 mph

2 4 6 8 10

Speed (mph)

slide-29
SLIDE 29

Deciding conditionals

if (Speed > 4) Alert("Keep it up!");

17

4 mph

2 4 6 8 10

Speed (mph)

Pr[Speed > 4]

slide-30
SLIDE 30

Deciding conditionals

if (Speed > 4) Alert("Keep it up!");

17

4 mph

2 4 6 8 10

Speed (mph)

Pr[Speed > 4] More likely than not that Speed > 4?

slide-31
SLIDE 31

Deciding conditionals

if ((Speed > 4).Pr(0.9)) Alert("Keep it up!");

18

4 mph

2 4 6 8 10

Speed (mph)

Pr[Speed > 4]

slide-32
SLIDE 32

Deciding conditionals

if ((Speed > 4).Pr(0.9)) Alert("Keep it up!");

18

4 mph

2 4 6 8 10

Speed (mph)

At least 90% likely that Speed > 4? Pr[Speed > 4]

slide-33
SLIDE 33

Identifying absurd data

19

GeoCoordinate PrevLocn = Get(); Sleep(5); GeoCoordinate Location = Get(); double Dist = Distance(LastLocn, Location); double Speed = Dist / 5; if (Speed > 4) // 7 mph Alert("That’s crazy!");

slide-34
SLIDE 34

Identifying absurd data

19

GeoCoordinate PrevLocn = Get(); Sleep(5); GeoCoordinate Location = Get(); double Dist = Distance(LastLocn, Location); double Speed = Dist / 5; if (Speed > 4) // 7 mph Alert("That’s crazy!"); Naive: 30 times

slide-35
SLIDE 35

Identifying absurd data

20

Uncertain<GeoCoordinate> PrevLocn = Get(); Sleep(5); Uncertain<GeoCoordinate> Location = Get(); Uncertain<double> Dist = Distance(LastLocn, Location); Uncertain<double> Speed = Dist / 5; if (Speed > 4) // 7 mph Alert("That’s crazy!"); Naive: 30 times

slide-36
SLIDE 36

Identifying absurd data

20

Uncertain<GeoCoordinate> PrevLocn = Get(); Sleep(5); Uncertain<GeoCoordinate> Location = Get(); Uncertain<double> Dist = Distance(LastLocn, Location); Uncertain<double> Speed = Dist / 5; if (Speed > 4) // 7 mph Alert("That’s crazy!"); Naive: 30 times 50%: 4 times

slide-37
SLIDE 37

Identifying absurd data

21

Uncertain<GeoCoordinate> PrevLocn = Get(); Sleep(5); Uncertain<GeoCoordinate> Location = Get(); Uncertain<double> Dist = Distance(LastLocn, Location); Uncertain<double> Speed = Dist / 5; if ((Speed > 4).Pr(0.9)) Alert("That’s crazy!"); Naive: 30 times 50%: 4 times

slide-38
SLIDE 38

Identifying absurd data

21

Uncertain<GeoCoordinate> PrevLocn = Get(); Sleep(5); Uncertain<GeoCoordinate> Location = Get(); Uncertain<double> Dist = Distance(LastLocn, Location); Uncertain<double> Speed = Dist / 5; if ((Speed > 4).Pr(0.9)) Alert("That’s crazy!"); Naive: 30 times 50%: 4 times 90%: never

slide-39
SLIDE 39

22

Uncertain<T> exploiting context

an abstraction for reasoning about noise [ASPLOS’14] language constructs to make data more accurate

slide-40
SLIDE 40

22

Uncertain< exploiting context

an abstraction for reasoning about noise language constructs to make data more accurate

slide-41
SLIDE 41

23

slide-42
SLIDE 42

23

slide-43
SLIDE 43

23

if (RecognizeBeard(photo)) AddBeardToAvatar();

slide-44
SLIDE 44

23

if (RecognizeBeard(photo)) AddBeardToAvatar();

slide-45
SLIDE 45

23

if (RecognizeBeard(photo)) AddBeardToAvatar(); City userCity = ...;

slide-46
SLIDE 46

23

if (RecognizeBeard(photo)) AddBeardToAvatar(); City userCity = ...;

context application-specific domain knowledge

slide-47
SLIDE 47

Static context

  • How does city influence beards?

24

Bernoulli HasBeard_City(City c) { if (c == "Seattle") return new Bernoulli(0.4); else return new Bernoulli(0.2); } var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities;

City Beard

slide-48
SLIDE 48

Static context

  • How does city influence beards?

24

Bernoulli HasBeard_City(City c) { if (c == "Seattle") return new Bernoulli(0.4); else return new Bernoulli(0.2); } var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities;

City Beard

slide-49
SLIDE 49

Static context

  • How does city influence beards?

24

Bernoulli HasBeard_City(City c) { if (c == "Seattle") return new Bernoulli(0.4); else return new Bernoulli(0.2); } var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities;

City Beard

slide-50
SLIDE 50

Static context

  • How does city influence beards?

24

Bernoulli HasBeard_City(City c) { if (c == "Seattle") return new Bernoulli(0.4); else return new Bernoulli(0.2); } var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities;

City Beard

slide-51
SLIDE 51

Static context

  • How does city influence beards?

24

Bernoulli HasBeard_City(City c) { if (c == "Seattle") return new Bernoulli(0.4); else return new Bernoulli(0.2); } var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities;

City Beard

slide-52
SLIDE 52

Static context

  • How does city influence beards?

24

Bernoulli HasBeard_City(City c) { if (c == "Seattle") return new Bernoulli(0.4); else return new Bernoulli(0.2); } var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities;

City Beard

slide-53
SLIDE 53

Static context

  • How does city influence beards?

24

Bernoulli HasBeard_City(City c) { if (c == "Seattle") return new Bernoulli(0.4); else return new Bernoulli(0.2); } var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities;

City Beard

slide-54
SLIDE 54

Dynamic context

  • Exploit knowledge about this user

25

var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities;

City Beard

slide-55
SLIDE 55

Dynamic context

  • Exploit knowledge about this user

25

var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities; Cities.Value = "Seattle";

City Beard

slide-56
SLIDE 56

Dynamic context

  • Exploit knowledge about this user

25

var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities; Cities.Value = "Seattle"; Bernoulli oldHasBeard = BeardRecognizer(photo);

City Beard

slide-57
SLIDE 57

Dynamic context

  • Exploit knowledge about this user

25

var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities; Cities.Value = "Seattle"; Bernoulli oldHasBeard = BeardRecognizer(photo); Bernoulli newHasBeard = oldHasBeard # HasBeard;

City Beard

slide-58
SLIDE 58

Dynamic context

  • Exploit knowledge about this user

25

var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities; Cities.Value = "Seattle"; Bernoulli oldHasBeard = BeardRecognizer(photo); Bernoulli newHasBeard = oldHasBeard # HasBeard; if (newHasBeard) AddBeardToAvatar();

City Beard

slide-59
SLIDE 59

Dynamic context

  • Exploit knowledge about this user

26

var Cities = Uniform(...); Bernoulli HasBeard = HasBeard_City <| Cities; Cities.Value = "Seattle"; Bernoulli oldHasBeard = BeardRecognizer(photo); Bernoulli newHasBeard = oldHasBeard # HasBeard; if (newHasBeard.Pr(0.9)) AddBeardToAvatar();

City Beard

<| #

slide-60
SLIDE 60

Two new constructs

27

<| #

Building probability distributions

(conditional probability)

Composing context and estimates

(Bayesian inference)

slide-61
SLIDE 61

Implementation

  • We designed a sequential likelihood

reweighting algorithm to implement this abstraction

  • But we’d like to compile down to

probabilistic programming languages, which have better inference

28

slide-62
SLIDE 62

Simon Says

29

slide-63
SLIDE 63

Simon Says

  • Xbox Kinect gesture recognition API

30

F₁-score 0.25 0.5 0.75 1 Person #1 #2 #3 #4 #5 #6 #7

Gesture1 Gesture2 Gesture3

slide-64
SLIDE 64

Simon Says

31

Local model

  • Specific to our user
  • Need lots of examples

to avoid noise

slide-65
SLIDE 65

Simon Says

31

Local model Global (API) model

  • Specific to our user
  • Need lots of examples

to avoid noise

  • Trained over many

users

  • Generalises well
slide-66
SLIDE 66

Simon Says

31

Local model Global (API) model

  • Specific to our user
  • Need lots of examples

to avoid noise

  • Trained over many

users

  • Generalises well

We’d like to keep both!

slide-67
SLIDE 67

Simon Says

  • Personalised gesture recognition model

32

F₁-score 0.25 0.5 0.75 1 Person #1 #2 #3 #4 #5 #6 #7

Gesture1 Gesture2 Gesture3

slide-68
SLIDE 68

33

Uncertain<T> exploiting context

an abstraction for reasoning about noise [ASPLOS’14] language constructs to make data more accurate

slide-69
SLIDE 69

33

Uncertain<T> exploiting context

an abstraction for reasoning about noise [ASPLOS’14] language constructs to make data more accurate

Thanks!