SPECTRAL CLUSTERING OF LARGE NETWORKS A. Fender, N. Emad, S. - - PowerPoint PPT Presentation

spectral clustering of large networks
SMART_READER_LITE
LIVE PREVIEW

SPECTRAL CLUSTERING OF LARGE NETWORKS A. Fender, N. Emad, S. - - PowerPoint PPT Presentation

SPECTRAL CLUSTERING OF LARGE NETWORKS A. Fender, N. Emad, S. Petiton, M. Naumov May 8th, 2017 Introduction Laplacian Agenda Modularity Conclusions 2 THE CLUSTERING PROBLEM Example : detect relevant groups based on frequent co-purchasing


slide-1
SLIDE 1
  • A. Fender, N. Emad, S. Petiton, M. Naumov

SPECTRAL CLUSTERING OF LARGE NETWORKS

May 8th, 2017

slide-2
SLIDE 2

2

Agenda

Introduction Laplacian Modularity Conclusions

slide-3
SLIDE 3

3

THE CLUSTERING PROBLEM

Example : detect relevant groups based on frequent co-purchasing

  • n Amazon.com

Visualization: M. Bastian, S. Heymann, and M. Jacomy. “Gephi: An Open Source Software for exploring and manipulating networks” 2009 Data: V. Krebs. 2004

slide-4
SLIDE 4

4

THE CLUSTERING PROBLEM

Pink Liberal Yellow Neutral Green Conservative

Data: V. Krebs. 2004 Visualization: M. Bastian, S. Heymann, and M. Jacomy. “Gephi: An Open Source Software for exploring and manipulating networks” 2009

slide-5
SLIDE 5

5

CLUSTERING ALGORITHMS

  • Spectral

Build a matrix, solve an eigenvalue problem, use eigenvectors for clustering

  • Hierarchical / Agglomerative

Build a hierarchy (fine to coarse), partition coarse, propagate results back to fine level

  • Local refinements

Switch one node at a time

A x x

fine coarse

slide-6
SLIDE 6

6

Laplacian

slide-7
SLIDE 7

7

RATIO CUT COST FUNCTION

Objective function: 𝐷𝑝𝑡𝑢 = 𝜖𝐹𝑗 𝑊

𝑗 𝑞 𝑗=1

where 𝜖𝐹𝑗 : # of edges cut and 𝑊

𝑗 : # of nodes in i-th partition

A compromise between small edge-cut and balanced partitions

𝐷𝑝𝑡𝑢 = 2 2 + 2 3 = 5 3

  • M. Naumov, T. Moon. “Parallel spectral graph partitioning.” Nvidia Technical Report, 2016.
slide-8
SLIDE 8

8

1 1 1 1 1 1 1 1 1 1

GRAPH LAPLACIAN

L = D − A

D: degree matrix A: adjacency matrix

1 3 3 2 1 1 -1

  • 1 3 -1 -1
  • 1 3 -1 -1
  • 1 -1 2
  • 1

1

= − 𝑀 𝐸 𝐵

1 2 3 4 5

  • M. Naumov, T. Moon. “Parallel spectral graph partitioning.” Nvidia Technical Report, 2016.
slide-9
SLIDE 9

9

GRAPH LAPLACIAN

For a vector x with elements that are 0 or 1: Number of edges cut Number of elements

1 2 3 4 5

|𝜖𝐹1| =

1 -1

  • 1 3 -1 -1
  • 1 3 -1 -1
  • 1 -1 2
  • 1

1

L

1 1

x

1 1

xT = 2 |𝑊1| = xT x = 2 V1 𝜖𝐹1

  • M. Naumov, T. Moon. “Parallel spectral graph partitioning.” Nvidia Technical Report, 2016.
slide-10
SLIDE 10

10

MINIMIZATION PROBLEM

min

xi xi TLxi

xi

Txi p i=1

where xi ∈ 0,1 n and xi ⊥ xj min

𝑊i 𝜖𝐹i

𝑊

i p i=1

1 2 3 4 5

V1 𝜖𝐹1 Next step Relax requirements on x, and let xi take real values

  • M. Naumov, T. Moon. “Parallel spectral graph partitioning.” Nvidia Technical Report, 2016.
slide-11
SLIDE 11

11

K-MEANS POINTS CLUSTERING

Points Centroids Lloyd’s Algorithm:

  • Select centroids
  • Compute distance of points to centroids
  • Assign points to the closest centroid
  • Recompute centroid position

p1 p2 pl … c1 ck

  • M. Naumov, T. Moon. “Parallel spectral graph partitioning.” Nvidia Technical Report, 2016.
slide-12
SLIDE 12

12

EDGE CUT MINIMIZATION PIPELINE

Eigensolver Clustering Points Clustering Graph Preprocessing

1.0 1.0 1.0 1.0 1.0

𝑦1

  • 1.0
  • 0.3

0.3 0.0 1.0

𝑦2

1 1

𝑦1

1 1 1

𝑦2

Laplacian

1

  • 1
  • 1

3

  • 1
  • 1
  • 1

3

  • 1
  • 1
  • 1
  • 1

2

  • 1

1

slide-13
SLIDE 13

13

Balanced cut minimization Ground truth

SPECTRAL EDGE CUT MINIMIZATION

80% hit rate

slide-14
SLIDE 14

14

Modularity

slide-15
SLIDE 15

15

Measures the difference between how well vertices are assigned into clusters for the current graph G = (V,E) versus a random graph R = (V,F). G = (V,E) R = (V,F) 𝑅 = 1 2𝜕 (𝑥𝑗𝑘

𝑘

− 𝑤𝑗𝑤𝑘 2𝜕 )

𝑗

𝜀𝑑 𝑗 𝑑(𝑘)

for some assignment c(.) into clusters.

MODULARITY FUNCTION

… … … …

  • A. Fender, N. Emad, S. Petiton, M. Naumov. “Parallel Modularity Clustering.” ICCS, 2017
slide-16
SLIDE 16

16

MODULARITY MATRIX

Let matrix 𝐶 = 𝐵 − 1 2𝜕 𝑤𝑤𝑈 then modularity Q =

1 2𝜕 𝑈𝑠(𝑌𝑈𝐶𝑌)

where Tr(.) is the trace (sum of diagonal elements) and X = [𝑦1, … , 𝑦𝑞] is such that 𝑦𝑗𝑙 = 1 𝑗𝑔 𝑑 𝑗 = 𝑙 .

1 2 3 4 5

1 1 1 1 1 1 1 1 1 1

𝐵

1 3 3 2 1

𝑤

  • A. Fender, N. Emad, S. Petiton, M. Naumov. “Parallel Modularity Clustering.” ICCS, 2017
slide-17
SLIDE 17

17

MODULARITY MAXIMIZATION PIPELINE

Eigensolver Clustering Points Clustering Graph Preprocessing

  • 0.5

0.0 0.0 0.6

  • 0.5

𝑦4

  • 0.6
  • 0.4

0.4 0.0 0.6

𝑦5

1 1

𝑦1

1 1 1

𝑦2

Modularity

1 1 1 1 1 1 1 1 1 1

− 1 2𝜕 𝑤𝑤𝑈

slide-18
SLIDE 18

18

SPECTRAL MODULARITY MAXIMIZATION

84% hit rate

Spectral Modularity maximization Ground truth

slide-19
SLIDE 19

19

PROFILING

The sparse matrix vector multiplication takes 90% of the time in the eigensolver The eigensolver takes 90% of the time

slide-20
SLIDE 20

20

MODULARITY VS. LAPLACIAN CLUSTERING

Nvidia Titan X (Pascal), Intel Core i7-3930K @3.2 GHz

Modularity  higher and steadier modularity score  3x speedup over Laplacian Laplacian  homogeneous cluster sizes

slide-21
SLIDE 21

21

SPEEDUP AND QUALITY VS. AGGLOMERATIVE*

*: D. LaSalle and G. Karypis. “Multi- threaded Modularity Based Graph Clustering Using the Multilevel Paradigm” Parallel Distrib. Comput., Vol. 76, pp. 66- 80, 2015.

Speedup 3x over agglomerative* scheme Tradeoff Speed vs. quality

0.8s on network with 100 million edges on a single Titan X GPU

Nvidia Titan X (Pascal), Intel Core i7-3930K @3.2 GHz

slide-22
SLIDE 22

22

Spectral Clustering in CUDA Toolkit 9.0 release of nvGRAPH

slide-23
SLIDE 23

23

CUDA TOOLKIT 9.0

nvGRAPH API

nvgraphStatus_t nvgraphSpectralClustering ( nvgraphHandle_t handle, const nvgraphGraphDescr_t graph_descr, const size_t weight_index, const struct SpectralClusteringParameter *params, int *clustering, void *eig_vals, void *eig_vects); struct SpectralClusteringParameter { int n_clusters; int n_eig_vects; nvgraphSpectralClusteringType_t alg float evs_tolerance int evs_max_iter; float kmean_tolerance; … };

slide-24
SLIDE 24

24

Conclusions

slide-25
SLIDE 25

25

SPECTRAL CLUSTERING

  • Software Framework
  • similar for both
  • Laplacian - Minimum balanced cut[1]
  • Probably the most common metric, with balancing involved in the cost function
  • Requires careful choice of eigensolver
  • Modularity maximization [2]
  • Widely used in analysis of social networks
  • Faster to compute

[1] M. Naumov, T. Moon. “Parallel spectral graph partitioning.” Nvidia Technical Report, 2016. [2] A. Fender, N. Emad, S. Petiton, M. Naumov. “Parallel Modularity Clustering.” ICCS, 2017.

slide-26
SLIDE 26

26

Thank you

H7129 - Accelerated Libraries Monday and Wednesday @ 4:00, Pod B

slide-27
SLIDE 27