77
Gaussian processes for data-driven modelling and uncertainty quantification: a hands-on tutorial Andreas Damianou Department of Computer Science, University of Sheffield, UK Brown University, 16/02/2016

GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Gaussian processes for data-driven modelling anduncertainty quantification: a hands-on tutorial

Andreas Damianou

Department of Computer Science, University of Sheffield, UK

Brown University, 16/02/2016

Page 2: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Sheffield

Page 3: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Outline

1. Gaussian processes as infinite dimensional Gaussiandistributions

1.1 Gaussian distribution1.2 Intuition by sampling and plotting1.3 Mean and covariance functions1.4 Marginalization and conditioning properties

2. Noise model

3. Covariance functions, aka kernels

4. “Full” GP implementation!

5. Running our GP

5.1 Fitting and overfitting

6. GPy

7. Classification

Page 4: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Gaussian distribution

Probability model: p(f1, f2) ∼ N (0,K)

−2 −1 0 1 2

−2

−1

0

1

2

f1

f 2

p(f

1, f

2) .

Covariance betweenf1 and f2:

K =

[1 0.92

0.92 1

]

Page 5: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Gaussian distribution

Probability model: p(f1, f2) ∼ N (0,K)

−2 −1 0 1 2

−2

−1

0

1

2

f1

f 2

p(f

1, f

2)

f2=0.35 .

Covariance betweenf1 and f2:

K =

[1 0.92

0.92 1

]

Page 6: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Gaussian distribution

Probability model: p(f1, f2) ∼ N (0,K)

−2 −1 0 1 2

−2

−1

0

1

2

f1

f 2

p(f

1, f

2)

f2=0.35

p(f1 | f

2=0.35)

Covariance betweenf1 and f2:

K =

[1 0.92

0.92 1

]

Page 7: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Gaussian distribution

Probability model: p(f1, f2) ∼ N (0,K)

−2 −1 0 1 2

−2

−1

0

1

2

f1

f 2

p(f

1, f

2) .

Covariance betweenf1 and f2:

K =

[1 0.50.5 1

]

Page 8: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Gaussian distribution

Probability model: p(f1, f2) ∼ N (0,K)

−2 −1 0 1 2

−2

−1

0

1

2

f1

f 2

p(f

1, f

2)

f2=0.35 .

Covariance betweenf1 and f2:

K =

[1 0.50.5 1

]

Page 9: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Gaussian distribution

Probability model: p(f1, f2) ∼ N (0,K)

−2 −1 0 1 2

−2

−1

0

1

2

f1

f 2

p(f

1, f

2)

f2=0.35

p(f1 | f

2=0.35)

Covariance betweenf1 and f2:

K =

[1 0.50.5 1

]

Page 10: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Introducing Gaussian Processes:

I A Gaussian distribution depends on a mean and a covariancematrix.

I A Gaussian process depends on a mean and a covariancefunction.

Page 11: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 12: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 13: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 14: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 15: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 16: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 17: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 18: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 19: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 20: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 21: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 22: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 23: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 24: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 25: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 26: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 27: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 28: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 29: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 30: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 31: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 32: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 33: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 34: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 35: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 36: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 37: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 38: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 39: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 40: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on
Page 41: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

GO TO NOTEBOOK (start)

Page 42: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Infinite model... but we always work with finite sets!

Let’s start with a multivariate Gaussian:

p(f1, f2, · · · , fs︸ ︷︷ ︸fA

, fs+1, fs+2, · · · , fN︸ ︷︷ ︸fB

) ∼ N (µ,K).

with:

µ =

[µA

µB

]and K =

[KAA KAB

KBA KBB

]Marginalisation property:

p(fA, fB) ∼ N (µ,K). Then:

p(fA) =

∫fB

p(fA, fB)dfB = N (µA,KAA)

Page 43: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Infinite model... but we always work with finite sets!

Let’s start with a multivariate Gaussian:

p(f1, f2, · · · , fs︸ ︷︷ ︸fA

, fs+1, fs+2, · · · , fN︸ ︷︷ ︸fB

) ∼ N (µ,K).

with:

µ =

[µA

µB

]and K =

[KAA KAB

KBA KBB

]Marginalisation property:

p(fA, fB) ∼ N (µ,K). Then:

p(fA) =

∫fB

p(fA, fB)dfB = N (µA,KAA)

Page 44: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Infinite model... but we always work with finite sets!

In the GP context f = f(x):

µ∞ =

µf

· · ·· · ·

and K∞ =

[K

ff· · ·

· · · · · ·

]

Covariance function: Maps locations xi, xj of the input domainX to an entry in the covariance matrix:

Ki,j = k(xi,xj)

For all available inputs:

K = Kff= k(X,X)

Page 45: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

GP: joint Gaussian distribution of the training and the(potentially infinite!) test data:

[ff∗

]∼ N

(0,

[K K∗K>∗ K∗,∗

])K∗ is the (cross)-covariance matrix obtained by evaluating the covariance

function in pairs of training inputs X and test inputs X∗, ie.

f∗ = k(X,X∗).

Similarly:

K∗∗ = k(X∗,X∗).

Page 46: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Posterior is also Gaussian!

p(fA, fB) ∼ N (µ,K). Then:

p(fA|fB) = N (µA +KABK−1BB(fB − µB),KAA −KABK

−1BBKBA)

In the GP context this can be used for inter/extrapolation:

p(f∗|f1, · · · , fN ) = p(f(x∗)|f(x1), · · · , f(xN )) ∼ Np(f∗|f1, · · · , fN) = p(f(x∗)|f(x1), · · · , f(xN ))

∼ N (K>∗K−1f , K∗,∗ −K>∗K

−1K∗)

p(f(x∗)|f(x1), · · · , f(xN )) is a posterior process!

Page 47: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Posterior is also Gaussian!

p(fA, fB) ∼ N (µ,K). Then:

p(fA|fB) = N (µA +KABK−1BB(fB − µB),KAA −KABK

−1BBKBA)

In the GP context this can be used for inter/extrapolation:

p(f∗|f1, · · · , fN ) = p(f(x∗)|f(x1), · · · , f(xN )) ∼ Np(f∗|f1, · · · , fN) = p(f(x∗)|f(x1), · · · , f(xN ))

∼ N (K>∗K−1f , K∗,∗ −K>∗K

−1K∗)

p(f(x∗)|f(x1), · · · , f(xN )) is a posterior process!

Page 48: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Noise model

I So far we assumed: f = f(X)I Assuming that we only observe noisy versions y of the true

outputs f :y = f(X) + ε, where:

f ∼ GP(0, k(x, x′))ε ∼ N (0, σ2I)

The above construction, gives us the following probabilities:

p(y|f) = N (y|f , σ2I)

p(f |x) = N (f |0,Kff ) = (2π)n/2|Kff |−1/2 exp(−1

2fTKff f

)p(y|x) =

∫p(y|f)p(f |x)df = N (y|0,Kff + σ2I)

p(y|x) is called the marginal likelihood and is tractable becauseof our choice for noise ε which is normally distributed.

Page 49: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Noise model

I So far we assumed: f = f(X)I Assuming that we only observe noisy versions y of the true

outputs f :y = f(X) + ε, where:

f ∼ GP(0, k(x, x′))ε ∼ N (0, σ2I)

The above construction, gives us the following probabilities:

p(y|f) = N (y|f , σ2I)

p(f |x) = N (f |0,Kff ) = (2π)n/2|Kff |−1/2 exp(−1

2fTKff f

)p(y|x) =

∫p(y|f)p(f |x)df = N (y|0,Kff + σ2I)

p(y|x) is called the marginal likelihood and is tractable becauseof our choice for noise ε which is normally distributed.

Page 50: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Noise model

I So far we assumed: f = f(X)I Assuming that we only observe noisy versions y of the true

outputs f :y = f(X) + ε, where:

f ∼ GP(0, k(x, x′))ε ∼ N (0, σ2I)

The above construction, gives us the following probabilities:

p(y|f) = N (y|f , σ2I)

p(f |x) = N (f |0,Kff ) = (2π)n/2|Kff |−1/2 exp(−1

2fTKff f

)p(y|x) =

∫p(y|f)p(f |x)df = N (y|0,Kff + σ2I)

p(y|x) is called the marginal likelihood and is tractable becauseof our choice for noise ε which is normally distributed.

Page 51: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Predictions in the noise model

y∗|y,x,x∗ ∼ N (µpred,Kpred)

withµpred = K>∗

[K+ σ2I

]−1y

andKpred = K∗,∗ −K>∗

[K+ σ2I

]−1K∗.

Page 52: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data (shaded area is uncertainty)

−2 −1 1 2

−3

−2

−1

1

2

3

Page 53: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data - Prior Samples

−2 −1 1 2

−3

−2

−1

1

2

3

Page 54: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data

−2 −1 1 2

−3

−2

−1

1

2

3

Page 55: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data

−2 −1 1 2

−3

−2

−1

1

2

3

Page 56: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data - more noise

−2 −1 1 2

−3

−2

−1

1

2

3

Page 57: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data - no noise

−2 −1 1 2

−3

−2

−1

1

2

3

Page 58: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data - Posterior samples

−2 −1 1 2

−3

−2

−1

1

2

3

Page 59: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data

−2 −1 1 2

−3

−2

−1

1

2

3

Page 60: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data

−2 −1 1 2

−3

−2

−1

1

2

3

Page 61: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data

−2 −1 1 2

−3

−2

−1

1

2

3

Page 62: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data

−2 −1 1 2

−3

−2

−1

1

2

3

Page 63: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data

−2 −1 1 2

−3

−2

−1

1

2

3

Page 64: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Fitting the data

−2 −1 1 2

−3

−2

−1

1

2

3

Page 65: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

GO TO NOTEBOOK (Cov. functions)

Page 66: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Curve fitting

2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.02.5

3.0

3.5

4.0

4.5

5.0

5.5

2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.02.5

3.0

3.5

4.0

4.5

5.0

5.5

2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.02.5

3.0

3.5

4.0

4.5

5.0

5.5

I Which curve fits the data better?

Page 67: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Curve fitting

2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.02.5

3.0

3.5

4.0

4.5

5.0

5.5

2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.02.5

3.0

3.5

4.0

4.5

5.0

5.5

2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.02.5

3.0

3.5

4.0

4.5

5.0

5.5

I Which curve fits the data better?

I Which curve is more “complex”?

Page 68: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Curve fitting

2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.02.5

3.0

3.5

4.0

4.5

5.0

5.5

2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.02.5

3.0

3.5

4.0

4.5

5.0

5.5

2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.02.5

3.0

3.5

4.0

4.5

5.0

5.5

I Which curve fits the data better?

I Which curve is more “complex”?

I Which curve is better overall?

Page 69: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Curve fitting

2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.02.5

3.0

3.5

4.0

4.5

5.0

5.5

2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.02.5

3.0

3.5

4.0

4.5

5.0

5.5

2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.02.5

3.0

3.5

4.0

4.5

5.0

5.5

I Which curve fits the data better?

I Which curve is more “complex”?

I Which curve is better overall?

Need a good balance between data fit vs overfitting!

Page 70: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

(Bayesian) Occam’s Razor

“A plurality is not to be posited without necessity”. W. of Ockham

“Everything should be made as simple as possible, but not simpler”. A. Einstein

Evidence is higher for the model that is not “unnecessarilycomplex” but still “explains” the data D.

Page 71: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

How do GPs solve the overfitting problem (i.e. regularize)?

I Answer: Integrate over the function itself!

I This is associated with the Bayesian methodology.

I So, we will average out all possible function forms, under a(GP) prior!

Recap:

ML: argmaxw

p(y|w, φ(x)) e.g. y = φ(x)>w + ε

Bayesian: argmaxθ

∫f p(y|f) p(f |x,θ︸ ︷︷ ︸

GP prior

) e.g. y = f(x,θ) + ε

I θ are hyperparameters

I The Bayesian approach (GP) automatically balances thedata-fitting with the complexity penalty.

Page 72: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

How do GPs solve the overfitting problem (i.e. regularize)?

I Answer: Integrate over the function itself!

I This is associated with the Bayesian methodology.

I So, we will average out all possible function forms, under a(GP) prior!

Recap:

ML: argmaxw

p(y|w, φ(x)) e.g. y = φ(x)>w + ε

Bayesian: argmaxθ

∫f p(y|f) p(f |x,θ︸ ︷︷ ︸

GP prior

) e.g. y = f(x,θ) + ε

I θ are hyperparameters

I The Bayesian approach (GP) automatically balances thedata-fitting with the complexity penalty.

Page 73: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

GO TO NOTEBOOK

Page 74: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Teaser for tomorrow

I Unsupervised learning with GPs (Bayesian non-lineardimensionality reduction)

I Deep GPs

I Dynamical systems

I ..and more...

Page 75: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Deep GP: Step function (credits for idea to J. Hensman)

| | | | | | | (standard GP)

| | | | | | | (deep GP - 1 hidden layer)

| | | | | | |

(deep GP - 3 hidden layers)

Page 76: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

Thanks

Thanks to Prof. Neil Lawrence, his SheffieldML group and theGPy developers.

Thanks to George Karniadakis, Paris Perdikaris for hosting me

Page 77: GitHub Pages - Gaussian processes for data-driven …adamian.github.io/talks/Damianou_16a_Brown.pdfGaussian processes for data-driven modelling and uncertainty quanti cation: a hands-on

EOF