1 of 74

Generative Modeling (1)

Atılım Güneş Baydin

gunes@robots.ox.ac.uk

based on slides by

Tom Rainforth (HT2020)

2 of 74

Outline

3 of 74

Outline

3

This lecture covers

  • Bayesian approach to modeling
  • What is a generative model?
  • What makes a good model and how do we compare between models?

Based on slides by Tom Rainforth https://www.robots.ox.ac.uk/~twgr/

for ATML HT2020

4 of 74

Why take a Bayesian approach?

5 of 74

Motivation: why take a Bayesian approach?

5

6 of 74

Motivation: why take a Bayesian approach?

6

Epidemiology (Wood et al. 2020)

Particle physics (Baydin et al. 2019)

Spacecraft collision avoidance (Acciarini et al. 2021)

7 of 74

Motivation: why take a Bayesian approach?

7

8 of 74

The Bayesian paradigm

9 of 74

Bayesian probability is all about belief

9

10 of 74

Bayesianism vs frequentism

10

11 of 74

Bayesianism vs frequentism

11

12 of 74

Bayesianism vs frequentism

12

13 of 74

Basic laws of probability

13

14 of 74

Using the Bayes Rule

14

Thomas Bayes

(1701 – 1761)

Evidence

(Marginal likelihood)

Likelihood

Prior

Posterior

15 of 74

Multiple observations: using the posterior as prior

15

16 of 74

Example: positive cancer test

16

17 of 74

Example: positive cancer test

17

18 of 74

Example: positive cancer test

18

19 of 74

Example: positive cancer test

19

The reason: “base rate neglect”

https://en.wikipedia.org/wiki/Base_rate_fallacy

More examples by Julia Galef

(highly recommended!)

https://youtu.be/BrK7X_XlGB8

20 of 74

The generative viewpoint

20

21 of 74

The Bayesian pipeline

21

22 of 74

Making predictions

22

23 of 74

Making predictions

23

24 of 74

Generative models

25 of 74

25

What is a model?

26 of 74

26

Example model: poker players reasoning about each other

27 of 74

27

Example model: poker players reasoning about each other

Check out N. D. Goodman, J. B. Tenenbaum, et al. (2016). Probabilistic Models of Cognition https://probmods.org/

28 of 74

28

Example: scientific simulators

Climate science

Cosmology

Weather

Drug discovery

Nuclear physics

Material design

Particle physics

29 of 74

29

What is a Bayesian model?

Thomas Bayes

(1701 – 1761)

30 of 74

How might we write a system to break captchas?

30

Example Bayesian model: captcha simulator

31 of 74

31

Example Bayesian model: captcha simulator

Rendered image

Correct letters

32 of 74

32

p( | Letters )

Correct letters

Example Bayesian model: captcha simulator

p( | Observed image)

Can be solved if we have a generative model (simulator) of p(letters, image)

Rendered image

33 of 74

Example Bayesian model: captcha simulator

33

Le, Baydin, Wood, “Inference compilation and universal probabilistic programming”, AISTATS 2017

34 of 74

34

Example Bayesian model: neuron growth

35 of 74

35

Example Bayesian model: Gaussian mixture model

36 of 74

36

Example Bayesian model: Gaussian mixture model

37 of 74

37

A fundamental assumption

38 of 74

“All models are wrong,

but some are useful”

George Box

(1919 – 2013)

39 of 74

39

What is the purpose of a model?

40 of 74

40

Some models can be better than others

41 of 74

41

Some models can be better than others

42 of 74

42

Some models can be better than others

43 of 74

Bayesian modeling through the eyes of multiple hypotheses

44 of 74

44

Bayesian modeling as multiple hypotheses

45 of 74

45

Example: density estimation

46 of 74

46

Example: density estimation

47 of 74

47

Example: density estimation

48 of 74

48

Example: density estimation

49 of 74

49

Example: density estimation

50 of 74

50

Bayesian modeling allows us to express our prior beliefs

51 of 74

51

Posterior predictive averages over hypotheses

52 of 74

52

Posterior predictive averages over hypotheses

53 of 74

53

Posterior predictive averages over hypotheses

54 of 74

54

Posterior predictive averages over hypotheses

55 of 74

55

An important subtlety

56 of 74

Model comparison:

what makes a good model?

57 of 74

57

Example: polynomial regression

Linear regression probably isn’t the best choice

58 of 74

58

Example: polynomial regression

59 of 74

59

Example polynomials for each degree

60 of 74

60

Least squares estimate for each degree

61 of 74

61

Perfectly matching the data is not enough

62 of 74

62

Perfectly matching the data is not enough

63 of 74

63

What went wrong?

64 of 74

64

Marginal likelihoods

65 of 74

65

Marginal likelihoods

66 of 74

66

Marginal likelihoods for polynomial regression

67 of 74

67

Bayesian Occam’s razor

William of Ockham

(1285 – 1347)

68 of 74

68

Bayesian Occam’s razor

69 of 74

69

Bayesian Occam’s razor

70 of 74

Summary

70

This lecture covered

  • Bayesian approach to modeling
  • What is a generative model?
  • What makes a good model and how do we compare between models?

Next lecture

  • Methods for constructing models
  • Graphical models
  • (Deep) probabilistic programming

71 of 74

Bayesian model averaging

72 of 74

72

Bayesian model averaging

73 of 74

73

Bayesian model averaging is not model combination

74 of 74

74

Further reading