-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeep_graph_0.html
476 lines (283 loc) · 12.7 KB
/
deep_graph_0.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
<!DOCTYPE html>
<html>
<head>
<title>Deep Learning on Graphs - overview [Marc Lelarge]</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="./assets/katex.min.css">
<link rel="stylesheet" type="text/css" href="./assets/slides.css">
<link rel="stylesheet" type="text/css" href="./assets/grid.css">
</head>
<body>
<textarea id="source">
class: center, middle, title-slide
count: false
# Deep Learning on Graphs
<br/><br/>
.bold[Marc Lelarge]
.bold[[www.dataflowr.com](https://www.dataflowr.com)]
---
# (1) Node embedding
## Inspired from language model (NLP)
### one fixed graph, no signal. Ex: community detection
# (2) Signal processing on graphs
## Fourier analysis on graphs
### one fixed graph, various signals. Ex: classification of signals
# (3) Graph embedding
## Graph Neural Networks
### various graphs. Ex: classification of graphs
---
# (1) Node embedding
## Inspired from language model (NLP)
### one fixed graph, no signal. Ex: community detection
# .gray[(2) Signal processing on graphs]
## .gray[Fourier analysis on graphs]
### .gray[one fixed graph, various signals. Ex: classification of signals]
# .gray[(3) Graph embedding]
## .gray[Graph Neural Networks]
### .gray[various graphs. Ex: classification of graphs]
---
# Node embedding
## Inspired from language model (NLP)
### one fixed graph, no signal. Ex: community detection
.center.width-30[]
- [DeepWalk](https://arxiv.org/abs/1403.6652)
- hierarchical softmax
- [node2vec](https://snap.stanford.edu/node2vec/)
- negative sampling
---
# Node embedding
.center.width-35[]
--
count: false
.center.width-35[]
--
count: false
.center.width-35[]
---
count: false
# DeepWalk: using a language model for node embedding
- Goal of a language model: to estimate the likelihood of a specific sequence of words appearing in a corpus.
- How: learn an embedding of each word in order to predict its probability of appearance in a given context.
--
count: false
- Building a corpus from a graph: a word = a node and a sentence = a random walk on the graph
.center.width-50[]
- Use the NLP algorithm [Word2vec](https://dataflowr.github.io/website/modules/8c-word2vec/) to learn node embedding
<!-- - Assign the contexts to the leaves of a binary tree and use the parametrization:
$$
p(c\|w; \theta) = \prod\_{b\in \pi(c)} \sigma(h\_b \cdot u\_w),
$$
where $\pi(c)$ is the path from the root to the leaf $c$ and $\sigma$ is the sigmoid function:
$$
\sigma(x) = \frac{1}{1+e^{-x}}.
$$ -->
.citation.tiny[ (Perozzi, Al-Rfou, Skiena [DeepWalk: Online Learning of Social Representations](https://arxiv.org/abs/1403.6652), 2014]
---
# node2vec
- parameterization of the skip-gram model approximated thanks to negative sampling
- notion of context obtained thanks to biased random walks.
<img align="left" width="500" src="images/graphs/node2vec_rw.png"><img align="right" width="500" src="images/graphs/RWn2v.png">
.citation.tiny[ Grover, Leskovec [node2vec: Scalable Feature Learning for Networks](https://snap.stanford.edu/node2vec/), 2016]
---
# Playing with the graph exploration
.center.width-40[]
---
# .gray[(1) Node embedding]
## .gray[Inspired from language model (NLP)]
### .gray[one fixed graph, no signal. Ex: community detection]
# (2) Signal processing on graphs
## Fourier analysis on graphs
### one fixed graph, various signals. Ex: classification of signals
# .gray[(3) Graph embedding]
## .gray[Graph Neural Networks]
### .gray[various graphs. Ex: classification of graphs]
---
# Signal processing on graphs
## Fourier analysis on graphs
### one fixed graph, various signals. Ex: classification of signals
.center.width-60[]
## Problem: how to implement a low-pass filter on a graph?
We first need to define a notion of frequency domain for graphs.
This will allow us to define convolutions on graphs.
---
# Filtering in computer vision
##convolution = product in spectral domain
.center.width-60[]
.citation[slide by Andrew Zisserman]
---
# Spectral graph theory
For a graph $G=(V,E)$, we denote by $A$ its adjacency matrix and we define its Laplacian by $L=D-A$ where $D = \text{diag}(A 1)$ is the diagonal matrix of (weighted) degrees.
--
count: false
## Analogy with $\Delta f = \sum\_{i=1}^d\frac{\partial^2 f}{\partial x\_i^2}$
Recall that $f''(x) \approx \frac{\frac{f(x+h)-f(x)}{h}-\frac{f(x)-f(x-h)}{h}}{h}=\frac{f(x+h)-f(x)+f(x-h)-f(x)}{h^2}$
If $f:V\to \mathbb{R}$, then
$$
L f (v) = \sum_{w\sim v} (f(v)-f(w))
$$
The Fourier transform allows us to write an arbitrary function as a superposition of eigenfunctions of the Laplacian. This approach works for general graphs!
.center.width-20[]
---
.center.width-50[]
.center[Nodal domain for $\lambda\_2$]
---
.center.width-50[]
.center[Nodal domain for $\lambda\_3$]
---
.center.width-50[]
.center[Nodal domain for $\lambda\_4$]
---
.center.width-50[]
.center[Nodal domain for $\lambda\_6$]
---
.center.width-50[]
.center[Nodal domain for $\lambda\_{10}$]
---
# Convolutional neural networks on graphs
### Performances on MNIST
.center.width-60[]
Underlying graph: 8-NN graph of the 2D grid of size $28\times 28$ with weight
$W\_{i,j} = e^{-\||z\_i-z\_j\||^2/\sigma^2}$,
where $z\_i$ is the 2D coordinate of pixel $i$.
.center.width-60[]
.citation.tiny[ Defferrard, Bresson, Vandergheynst [CNN on graphs with fast localized spectral filtering](https://arxiv.org/abs/1606.09375), 2016]
---
# .gray[(1) Node embedding]
## .gray[Inspired from language model (NLP)]
### .gray[one fixed graph, no signal. Ex: community detection]
# .gray[(2) Signal processing on graphs]
## .gray[Fourier analysis on graphs]
### .gray[one fixed graph, various signals. Ex: classification of signals]
# (3) Graph embedding
## Graph Neural Networks
### various graphs. Ex: classification of graphs
---
# Graph embedding
## Graph Neural Networks
### various graphs. Ex: classification of graphs
.center.width-40[]
---
# How to represent a graph?
.center.width-30[]
--
count: false
Result of seeing an image where nodes are pixels and where we
replace the grid by the complete graph:
.center.width-60[]
--
count: false
We only consider algorithms whose result does not depend on the particular representation of the graph.
<!-- In graph theory, graph canonization is the problem of finding a canonical form of a given graph $G$ (i.e. every graph that is isomorphic to $G$ should have the same canonical form as $G$).
Thus, from a solution to the graph canonization problem, one could also solve the problem of graph isomorphism... -->
---
# Message passing GNN (MGNN)
Grid vs graph:
.center.width-30[]
--
count: false
.center.width-60[]
.citation[image from Thomas Kipf]
---
count: false
# Message passing GNN (MGNN)
Grid vs graph:
.center.width-30[]
.red[MGNN] takes as input a discrete graph $G=(V,E)$ with $n$ nodes and
features on the nodes $h^0\in \mathbb{F}^n$ and are defined inductively as:
$h^\ell\_i \in \mathbb{F}$ being the features at layer $\ell$ associated with node $i$, then
$$
h^{\ell+1}\_i = f\left( h\_i^\ell, \left[h\_j^\ell\right]\_{j\sim i}\right),
$$
where $f$ is a learnable function and $[\cdot]$ represents the multiset.
.center.width-40[]
---
# The many flavors of MGNN
The message passing layer can be expressed as (i.e. for each $f$ there exist $f\_0$ and $f\_1$ such that):
$$
h^{\ell+1}\_i = f\left( h\_i^\ell, \left[h\_j^\ell\right]\_{j\sim i}\right)=
f\_0\left(h\_i^\ell, \sum\_{j\sim i}f\_1\left( h^\ell\_i, h\_j^\ell\right)\right).
$$
By varying the functions $f\_0$ and $f\_1$, you get: [vanilla GCN](https://arxiv.org/abs/1609.02907),
[GraphSage](https://arxiv.org/abs/1706.02216), [Graph Attention Network](https://arxiv.org/abs/1710.10903), [MoNet](https://openaccess.thecvf.com/content_cvpr_2017/html/Monti_Geometric_Deep_Learning_CVPR_2017_paper.html), [Gated Graph ConvNet](https://arxiv.org/abs/1711.07553),
[Graph Isomorphism Networks](https://arxiv.org/abs/1810.00826)...
<center>GCN:</center>
.center.width-30[]
<center>GraphSage:</center>
.center.width-30[]
<center>GIN:</center>
.center.width-30[]
---
# Results with GIN
.center.width-80[]
Guess from which paper these results are taken from?
.center.width-10[]
---
# Expressive power of GNN
Motivation for invariant/equivariant algorithms : by restricting the class of
functions we are learning, we lower the complexity of the model and
improve its robustness and generalization.
To learn a function that is known to be invariant to some symmetries, we
use layers that respect this symmetry. Can such a network
approximate an arbitrary continuous invariant function ?
### Ex: a problematic pair .center.width-30[]
--
count: false
MGNNs are unable to distinguish $d$-regular graphs.
By increasing the complexity of the GNN architectures, it is possible to build more expressive GNNs: [Provably Powerful Graph Networks](https://arxiv.org/abs/1905.11136), [Expressive Power of Invariant and Equivariant Graph Neural Networks](https://arxiv.org/abs/2006.15646)
---
# Thank you !
For more details:
- [Node embedding](https://dataflowr.github.io/website/modules/graph1/)
- [Signal processing on graphs](https://dataflowr.github.io/website/modules/graph2/)
- [Graph embedding](https://dataflowr.github.io/website/modules/graph3/)
- [Inductive bias in GCN: a spectral perspective](https://dataflowr.github.io/website/modules/extras/GCN_inductivebias_spectral/#inductive_bias_in_gcn_a_spectral_perspective)
- [Invariant and equivariant layers with applications to GNN, PointNet and Transformers](https://dataflowr.github.io/website/modules/extras/invariant_equivariant/)
- [Exploiting Graph Invariants in Deep Learning](https://dataflowr.github.io/website/modules/extras/graph_invariant/)
.center.bold[[www.dataflowr.com](https://www.dataflowr.com)]
</textarea>
<script src="./assets/remark-latest.min.js"></script>
<script src="./assets/auto-render.min.js"></script>
<script src="./assets/katex.min.js"></script>
<script type="text/javascript">
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
// var options = {sourceUrl: getParameterByName("p"),
// highlightLanguage: "python",
// // highlightStyle: "tomorrow",
// // highlightStyle: "default",
// highlightStyle: "github",
// // highlightStyle: "googlecode",
// // highlightStyle: "zenburn",
// highlightSpans: true,
// highlightLines: true,
// ratio: "16:9"};
var options = {sourceUrl: getParameterByName("p"),
highlightLanguage: "python",
highlightStyle: "github",
highlightSpans: true,
highlightLines: true,
ratio: "16:9",
slideNumberFormat: (current, total) => `
<div class="progress-bar-container">${current}/${total} <br/><br/>
<div class="progress-bar" style="width: ${current/total*100}%"></div>
</div>
`};
var renderMath = function() {
renderMathInElement(document.body, {delimiters: [ // mind the order of delimiters(!?)
{left: "$$", right: "$$", display: true},
{left: "$", right: "$", display: false},
{left: "\\[", right: "\\]", display: true},
{left: "\\(", right: "\\)", display: false},
]});
}
var slideshow = remark.create(options, renderMath);
</script>
</body>
</html>