N UMERICAL R ESULTS (Q UALITY , S PEEDUP ) H 2 -matrix stored - - PowerPoint PPT Presentation

n umerical r esults q uality s peedup
SMART_READER_LITE
LIVE PREVIEW

N UMERICAL R ESULTS (Q UALITY , S PEEDUP ) H 2 -matrix stored - - PowerPoint PPT Presentation

H 2 - MATRIX G AUSSIAN P ROCESSES H IERARCHICAL MATRICES R ESULTS A PPROXIMATING G AUSSIAN P ROCESSES WITH H 2 - MATRICES Steffen Brm 1 Jochen Garcke 2 1 Christian-Albrechts-Universitt zu Kiel 2 Universitt Bonn and Fraunhofer SCAI 1 / 23 H 2


slide-1
SLIDE 1

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

APPROXIMATING GAUSSIAN PROCESSES

WITH H2-MATRICES

Steffen Börm1 Jochen Garcke2

1Christian-Albrechts-Universität zu Kiel 2Universität Bonn and Fraunhofer SCAI

1 / 23

slide-2
SLIDE 2

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

OUTLINE

1 GAUSSIAN PROCESSES 2 HIERARCHICAL MATRICES 3 H2-MATRIX 4 RESULTS 2 / 23

slide-3
SLIDE 3

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

GAUSSIAN PROCESSES

given set of data S = {(xi, yi) ∈ ❘d × ❘}N

i=1

assuming a Gaussian process prior on f(x), i.e values f(x) are Gaussian distributed with zero mean and covariance matrix K kernel (or covariance) function k(·, ·) defines K via Ki,j = k(xi, xj). typical kernel: Gaussian RBF k(x, y) = e−x−y2/w representer theorem gives solution f(x) as f(x) =

N

  • i=1

αik(xi, x) coefficient vector α is the solution of the linear equation system (K + σ2I)α = y full N × N matrix → O(N2) complexity, unfeasible for large data approximation needed, e.g.

use subset of size M in computational core → O(M2 · N) use iterative solver with approximation of matrix vector product Kα

3 / 23

slide-4
SLIDE 4

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

HIERARCHICAL MATRICES

data sparse approximation of kernel matrix O(Nm log N) for storage, (local rank) m controls accuracy

  • perations like matrix-vector product, matrix multiplication or

inversion can now be computed efficiently efficient computation of H-matrix approximation needed H-matrix approach developed for efficient treatment of dense matrix arising from discretization of integral operators efficient computation for 2D, 3D problems exists strongly related to fast multipole, panel clustering, fast gauss transform

4 / 23

slide-5
SLIDE 5

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

1D MODEL PROBLEM

in the following we present the underlying ideas in one dimension

τ ̺ τ ̺

we look at blocks in the (permuted) matrix whose corresponding subregions have a certain 1D-distance employ Taylor-expansion to approximate kernel Taylor-expansion only used for explanation, but not in algorithm

5 / 23

slide-6
SLIDE 6

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

PANEL CLUSTERING

DEGENERATE APPROXIMATION: If k is sufficiently smooth in a subdomain τ × ̺, we can approximate by a Taylor series: ˜ k(x, y) :=

m−1

  • ν=0

(x − xτ)ν ν! ∂νk ∂xν (xτ, y) (x ∈ τ, y ∈ ̺) FACTORIZATION: For i, j ∈ I with xi ∈ τ and xj ∈ ̺ we find Kij = k(xi, xj) ≈ ˜ k(xi, xj) =

m−1

  • ν=0

(xi − xτ)ν ν!

  • =(Aτ,̺)iν

∂νk ∂xν (xτ, xj)

  • =(Bτ,̺)jν

=

m−1

  • ν=0

(Aτ,̺)iν(Bτ,̺)jν

6 / 23

slide-7
SLIDE 7

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

PANEL CLUSTERING

DEGENERATE APPROXIMATION: If k is sufficiently smooth in a subdomain τ × ̺, we can approximate by a Taylor series: ˜ k(x, y) :=

m−1

  • ν=0

(x − xτ)ν ν! ∂νk ∂xν (xτ, y) (x ∈ τ, y ∈ ̺) FACTORIZATION: For the sets ˆ τ := {i : xi ∈ τ}, ˆ ̺ := {j : xj ∈ ̺} we find K|ˆ

τ׈ ̺ ≈ Aτ,̺B⊤ τ,̺

Storage m(#ˆ τ + #ˆ ̺) instead of (#ˆ τ)(#ˆ ̺). RESULT: Significant reduction of storage requirements if m ≪ #ˆ τ, #ˆ ̺.

6 / 23

slide-8
SLIDE 8

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

CLUSTER TREE AND BLOCK PARTITION

GOAL: Split Ω × Ω into subdomains satisfying the admissibility condition diam(τ) ≤ 2 dist(τ, ̺) (≤ 2 for demonstration purposes) Start with τ = ̺ = Ω. Nothing is admissible.

7 / 23

slide-9
SLIDE 9

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

CLUSTER TREE AND BLOCK PARTITION

GOAL: Split Ω × Ω into subdomains satisfying the admissibility condition diam(τ) ≤ 2 dist(τ, ̺) τ and ̺ are subdivided. Still nothing is admissible.

7 / 23

slide-10
SLIDE 10

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

CLUSTER TREE AND BLOCK PARTITION

GOAL: Split Ω × Ω into subdomains satisfying the admissibility condition diam(τ) ≤ 2 dist(τ, ̺)

τ ̺ τ ̺ dist

We split the intervals again. And find an admissible block.

7 / 23

slide-11
SLIDE 11

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

CLUSTER TREE AND BLOCK PARTITION

GOAL: Split Ω × Ω into subdomains satisfying the admissibility condition diam(τ) ≤ 2 dist(τ, ̺) We find six admissible blocks on this level.

7 / 23

slide-12
SLIDE 12

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

CLUSTER TREE AND BLOCK PARTITION

GOAL: Split Ω × Ω into subdomains satisfying the admissibility condition diam(τ) ≤ 2 dist(τ, ̺) The procedure is repeated...

7 / 23

slide-13
SLIDE 13

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

CLUSTER TREE AND BLOCK PARTITION

GOAL: Split Ω × Ω into subdomains satisfying the admissibility condition diam(τ) ≤ 2 dist(τ, ̺) (up to a small remainder). The procedure is repeated until

  • nly a small subdomain remains.

RESULT: Domain Ω × Ω partitioned into blocks τ × ̺. Clusters τ, ̺ ⊆ Ω organized in a cluster tree.

7 / 23

slide-14
SLIDE 14

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

HIERARCHICAL MATRIX

IDEA: Use low-rank approximation in all admissible blocks ˆ τ × ˆ ̺. Standard representation of original matrix K requires N2 units of storage.

8 / 23

slide-15
SLIDE 15

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

HIERARCHICAL MATRIX

IDEA: Use low-rank approximation in all admissible blocks ˆ τ × ˆ ̺. Replace admissible block K|ˆ

τ׈ ̺ by

low-rank approximation

  • K|ˆ

τ׈ ̺ = Aτ,̺B⊤ τ,̺. 8 / 23

slide-16
SLIDE 16

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

HIERARCHICAL MATRIX

IDEA: Use low-rank approximation in all admissible blocks ˆ τ × ˆ ̺. Replace all admissible blocks by low-rank approximations, leave inadmissible blocks unchanged. RESULT: Hierarchical matrix approximation K of K. STORAGE REQUIREMENTS: One row of K represented by only O(m log N) units of storage, total storage requirements O(Nm log N).

8 / 23

slide-17
SLIDE 17

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

SECOND APPROACH: CROSS APPROXIMATION

OBSERVATION: If M is a rank 1 matrix and we have pivot indices i∗, j∗ with Mi∗j∗ = 0, we get the representation M = ab⊤, ai := Mij∗/Mi∗j∗, bj := Mi∗j. IDEA: If M can be approximated by a rank 1 matrix, we still can find i∗, j∗ with Mi∗j∗ = 0 and M ≈ ab⊤. HIGHER RANK: Repeating the procedure for the error matrix yields rank m approximation of arbitrary accuracy. EFFICIENT: If the pivot indices are known, only m rows and columns of M are required to construct a rank m approximation. PROBLEM: Selection of pivot indices. Efficient strategies needed. Provable in certain settings. For our case it works (but till did not work on a proof)

9 / 23

slide-18
SLIDE 18

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

UNIFORM HIERARCHICAL MATRIX

GOAL: Reduce the storage requirements. APPROACH: Expansion in both variables k(x, y) ≈

  • ν+µ<m

∂ν+µk ∂xν∂yµ (xτ, y̺)(x − xτ)ν ν! (y − y̺)µ µ! yields low-rank factorization K|ˆ

τ׈ ̺ ≈ VτSτ,̺V ⊤ ̺ ,

(Vτ)iν := (xi − xτ)ν ν! dx, (Sτ,̺)νµ := ∂ν+µk ∂xν∂yµ (xτ, y̺). IMPORTANT: Vτ depends only on one cluster (τ). Only the small matrix Sτ,̺ ∈ Rm×m depends on both clusters.

10 / 23

slide-19
SLIDE 19

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

H2-MATRIX

IDEA: Use three-term factorization in all admissible blocks ˆ τ × ˆ ̺. Standard representation of original matrix K requires N2 units of storage.

11 / 23

slide-20
SLIDE 20

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

H2-MATRIX

IDEA: Use three-term factorization in all admissible blocks ˆ τ × ˆ ̺. Replace admissible block K|ˆ

τ׈ ̺ by

low-rank approximation

  • K|ˆ

τ׈ ̺ = VτSτ,̺V ⊤ ̺ . 11 / 23

slide-21
SLIDE 21

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

H2-MATRIX

IDEA: Use three-term factorization in all admissible blocks ˆ τ × ˆ ̺. Replace all admissible blocks by low-rank approximations, leave inadmissible blocks unchanged.

11 / 23

slide-22
SLIDE 22

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

H2-MATRIX

IDEA: Use three-term factorization in all admissible blocks ˆ τ × ˆ ̺. Use nested representation for the cluster basis. Use transfer matrices Tτ ′ ∈ Rk×k with Vτ|ˆ

τ ′×k = Vτ ′Tτ ′ for all sons

τ ′ ∈ sons(τ) to handle cluster basis (Vτ) efficiently. RESULT: H2-matrix approximation K of K. STORAGE REQUIREMENTS: One row of K represented by only O(m) units of storage, total storage requirements O(Nm).

11 / 23

slide-23
SLIDE 23

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

OVERALL ALGORITHM

1: build hierarchy of clusters t by binary space partitioning 2: build blocks t × s using the admissibility criterion 3: for all admissible blocks t × s do 4:

use ACA to compute a low-rank approximation K|t×s = AB⊤

5: end for 6: for all remaining blocks t × s do 7:

compute standard representation K|t×s = K|t×s

8: end for 9: coarsen the block structure adaptively with blockwise SVD 10: convert the H-matrix into an H2-matrix

12 / 23

slide-24
SLIDE 24

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

NUMERICAL RESULTS

data sets

network of simple sensor motes (Intel Lab Data) predict the temperature at a mote from the measurements of neighbouring ones mote22 consists of 30000 training / 2500 test from 2 other motes mote47 has 27000 training / 2000 test from 3 nearby motes helicopter flight project predict yaw rate in next timestep based on 3 measurements heliYaw has 40000 training / 4000 test data in 3 dimensions

using Gaussian RBF kernel e−x−y2/w hyperparameters w and σ were found using a 2:1 split of the training data for each data set size note: a H2-matrix approximation can be used for several σ disregard actual runtimes, only compare (numbers from 2007)

13 / 23

slide-25
SLIDE 25

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

NUMERICAL RESULTS (QUALITY, SPEEDUP)

stored

  • .t.fly

(f. both) H2-matrix data set #data time time error time error KB/N mote 22 20000 2183 21050 0.2785 230 0.2787 2.0 mote 22 30000 n/a 88033 0.2577 494 0.2577 3.7 mote 47 20000 3800 36674 0.1326 1022 0.1326 16.4 mote 47 27000 n/a 73000 0.1289 1625 0.1289 17.2 heliYaw 20000 1091 10781 0.0091 676 0.0092 2.3 heliYaw 40000 n/a 162789 0.0083 3454 0.0083 6.6 matrix for N = 20000 can (barely) be stored speedups of two orders of magnitude for large data sets twice to ten-times the speedup of related work storage reduction of more than one order of magnitude for helicopter data set from 156.25 down to 6.6, or in total from about 6 GB to about 250 MB

14 / 23

slide-26
SLIDE 26

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

MOTE22: H2-MATRIX APPROXIMATION FOR 5000 DATA

58 19 20 71 20

19

80 22 20 50

23 23

122 21 21

54 19 19 69 19 20 83 18

19

52 16 16 127 2 2 2 23

23

90 27 27 105 28 29 107 22 20 119 32

32

72 29 30 86 25 25 76 21 19 94 24

23

29 20 19 64 20 20 92 19 18 67 29

30

7 7 7 89 21 22 72 19 19 79 18 18 75 21 21 105 11 11 11

23

20

20

26 25 25 20 20 23

34

33

46

46

23 46

19 23

19

24 22 24 22 31 23 31

46

17 15 14 63 20 20

110 22

22 55 8 8 8

30 28

40 22 21 106 23

22

82 20 21 60 25 25 77 30 29 54 28

28

88 22 21 58 26 26 102 23 23 32 51

47

58 38 38

108 30 28 76

23 24 30 31

30

45 26 26 97 40 38 76 56

58

92 34 34 12420 20 23 32 32 74 33 32 75 23 23 34 25

25 21 21 28 19 19

2 2 19 23 46 29 29 27 22 22 33 34 33

36

36 30 30 46

23 23 46 39

42

50 30 30 42 36

29

50

29

50 39

23 31

23

26 21 26 21 18

2

18

2 26 18 42 29 28 27 28 20 32 20 34

32

32 32

29

23 46

42

23 46

23 37

49 49 28 43 28 36

50

28 28

37

92 50 48 105 39 38 57 32 33 72 48 47 91 64 62 118 46

46

126 39 37 97 36 36

55 33 32 92 29 28 58

difference between full matrix and H2-matrix is 3.79 · 10−8 in the spectral norm

15 / 23

slide-27
SLIDE 27

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

MOTE 22: STUDY SCALING OF APPROACHES

using w = 2−9 and σ = 2−5 for different data set sizes compare runtime per iteration for the different values of N

  • n-the-fly computation expected O(N2) scaling

stored matrix even worse than O(N2) from 10000 to 20000 data for H2-matrix scaling is nearly like O(Nm) 1000 5000 10000 20000 30000 H2-matrix time 1.43 22.64 75.0 230.0 427.5 its 284 688 1111 1599 2025 time/its 0.00504 0.0329 0.0675 0.144 0.211 stored matrix time 1.18 51.15 324.1 2183 its 284 689 1103 1596 n/a time/its 0.00415 0.0742 0.29383 1.368

  • n-the-fly

time 9.13 565.2 3620.2 21050 60990 its 284 689 1103 1596 2005 time/its 0.032 0.82 3.282 13.189 30.42

16 / 23

slide-28
SLIDE 28

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

MOTE22, DIFFERENT DATA SET SIZES USING ‘OPTIMAL’ PARAMETERS w / σ

#data w / σ stored

  • .t.fly

error H2 error KB/N 1000 2−3/2−6 0.3 1.1 0.350 1.56 0.350 0.8 5000 2−7/2−7 30 296 0.318 22.8 0.319 1.1 10000 2−7/2−8 811 8502 0.304 76.2 0.307 1.1 20000 2−9/2−5 2183 19525 0.279 230.1 0.279 2.0 30000 2−11/2−5 n/a 88033 0.258 494.8 0.258 3.7 ‘optimal’ w / σ found via 2:1 split of training data

  • bserve different ‘optimal’ w / σ found for each data set size

→ need for parameter tuning on large data set runtime of H2-matrix starts to make an improvement against stored matrix after 5000 data points more data useful for better results

17 / 23

slide-29
SLIDE 29

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

EFFECT OF σ ON NUMBER OF ITERATIONS

using the 30000 data of mote22 results are from 2:1 split using w = 2−8 and different σ i.e. matrix size is 20000

  • bserve how number of iterations of GMRES depends on σ

σ 2−7 2−6 2−5 2−4 2−3 2−2 2−1 20 MAE 0.265 0.263 0.264 0.265 0.268 0.275 0.289 0.320 its 3000 2375 597 179 91 70 55 41 note: with smaller w the number of iterations usually grows as well

18 / 23

slide-30
SLIDE 30

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

HOW CAN ONE GO INTO HIGHER DIMENSIONS

question: how many dimensions can be handled ? related recent fast Gauss-transform can give insights refer approach and study from

  • M. Griebel and D. Wissel, Fast approximation of the discrete Gauss

transform in higher dimensions. Journal of Scientific Computing, 2013. their study compares

FGT (Greengard and Strain, 1991) Improved FGT (Yang , Duraiswami, and Gumerov, 2003) Dual-Tree FGT (Lee, Gray, and Moore, 2005) Optimized FGT (Griebel and Wissel, 2013)

study dependence of algorithms on dimension and bandwitdh

19 / 23

slide-31
SLIDE 31

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

OBSERVATIONS FROM GRIEBEL AND WISSEL I

uniform data 10−3 10−1 101 1,000 2,000 N = 200,000 h dc 5 dc 10 dc 20

  • f 5
  • f 10
  • f 20

20 / 23

slide-32
SLIDE 32

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

OBSERVATIONS FROM GRIEBEL AND WISSEL II

real life data is not uniform

10−3 10−1 101 50 100 dc cMo3 dc cTe4 dc bio6

  • f cMo3
  • f cTe4
  • f bio6

21 / 23

slide-33
SLIDE 33

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

OBSERVATIONS FROM GRIEBEL AND WISSEL III

real life data is not uniform

10−3 10−1 101 100 200 dc shu9 dc gal21 dc aco50

  • f shu9
  • f gal21
  • f aco50

22 / 23

slide-34
SLIDE 34

GAUSSIAN PROCESSES HIERARCHICAL MATRICES H2-MATRIX RESULTS

CONCLUSIONS

H2-matrices for approximating Gaussian Processes time O(Nm log(N)), storage O(Nm) handling of large data sets how to efficiently built H2-matrix in higher dim’s H2Lib available at http://www.h2lib.org References (and see references therein):

Börm and Garcke, Approximating Gaussian Processes with H2-matrices. ECML 2007, pages 42-53, 2007. Griebel and Wissel, Fast approximation of the discrete Gauss transform in higher dimensions. Journal of Scientific Computing, 55(1):149-172, 2013.

23 / 23