-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.xml
1118 lines (714 loc) · 87.8 KB
/
index.xml
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
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Graph Deep Learning Lab</title>
<link>https://graphdeeplearning.github.io/</link>
<atom:link href="https://graphdeeplearning.github.io/index.xml" rel="self" type="application/rss+xml" />
<description>Graph Deep Learning Lab</description>
<generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><copyright>Xavier Bresson © 2020 · Made with &hearts; by [Chaitanya Joshi](https://chaitjo.github.io/)</copyright><lastBuildDate>Thu, 28 Jun 2018 00:00:00 +0000</lastBuildDate>
<image>
<url>https://graphdeeplearning.github.io/images/icon_hu027d87ac1e37f4f802995042c9999554_21044_512x512_fill_lanczos_center_2.png</url>
<title>Graph Deep Learning Lab</title>
<link>https://graphdeeplearning.github.io/</link>
</image>
<item>
<title>Benchmarking Graph Neural Networks</title>
<link>https://graphdeeplearning.github.io/post/benchmarking-gnns/</link>
<pubDate>Mon, 15 Jun 2020 03:03:47 +0800</pubDate>
<guid>https://graphdeeplearning.github.io/post/benchmarking-gnns/</guid>
<description><p><em>This blog is based on the paper <a href="https://arxiv.org/abs/2003.00982">Benchmarking Graph Neural Networks</a> which is a joint work with <a href="https://chaitjo.github.io">Chaitanya K. Joshi</a>, <a href="http://thomaslaurent.lmu.build/homepage.html">Thomas Laurent</a>, <a href="https://mila.quebec/en/person/bengio-yoshua/">Yoshua Bengio</a> and <a href="https://www.ntu.edu.sg/home/xbresson/">Xavier Bresson</a>.</em></p>
<hr>
<p><a href="https://graphdeeplearning.github.io/project/spatial-convnets/">Graph Neural Networks (GNNs)</a> are widely used today in diverse applications of <a href="https://arxiv.org/abs/1609.02907">social</a> <a href="https://arxiv.org/abs/1902.06673">sciences</a>, <a href="https://arxiv.org/abs/1703.06103">knowledge</a> <a href="https://arxiv.org/abs/2005.00545">graphs</a>, <a href="https://arxiv.org/abs/1704.01212">chemistry</a>, <a href="https://arxiv.org/abs/2002.09405">physics</a>, <a href="https://infoscience.epfl.ch/record/229954?ln=en">neuroscience</a>, etc., and accordingly there has been a great surge of interest and growth in the number of papers in the literature.</p>
<p>However, it has been increasingly difficult to gauge the effectiveness of new models and validate new ideas that generalize universally to larger and complex datasets <strong>in the absence of</strong> a standard and widely-adopted <strong>benchmark</strong>.</p>
<p><strong>To address</strong> this paramount concern existing in graph learning research, we develop an open-source, easy-to-use and reproducible <a href="https://github.com/graphdeeplearning/benchmarking-gnns">benchmarking framework</a> with a rigorous experimental protocol that is representative of the categorical advances in GNNs.</p>
<div class="alert alert-note">
<div>
This post outlines the <a href="https://arxiv.org/abs/1912.09893">issues</a> <a href="https://arxiv.org/abs/1905.09550">in</a> <a href="https://arxiv.org/abs/1905.04682">the</a> <a href="https://arxiv.org/abs/1905.04579">GNN</a> literature suggesting the need of a benchmark, the framework proposed in the <a href="https://arxiv.org/abs/2003.00982">paper</a>, the broad classes of widely used and powerful GNNs benchmarked and the insights learnt from the extensive experiments.
</div>
</div>
<hr>
<h3 id="why-benchmark">Why benchmark?</h3>
<p>In any core research or application area in <a href="https://www.nature.com/articles/nature14539">deep learning</a>, a benchmark helps to identify and quantify what types of <a href="https://arxiv.org/abs/1409.4842">architectures</a>, <a href="https://arxiv.org/abs/1512.03385">principles</a>, or <a href="https://arxiv.org/abs/1502.03167">mechanisms</a> are universal and generalizable to real-world tasks and large datasets. Particularly, the <a href="https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf">recent</a> <a href="https://cacm.acm.org/magazines/2017/6/217744-technical-perspective-what-led-computer-vision-to-deep-learning/fulltext">revolution</a> in this AI field is often credited, <em>to a possibly large extent</em>, to be triggered by the large-scale benchmark image dataset, <a href="http://www.image-net.org">ImageNet</a>. (Obviously, other driving factors include increase in the volume of research, more datasets, compute, wide-adoptance, etc.)</p>
<figure>
<a data-fancybox="" href="imagenet_leaderboard.png" data-caption="Fig 1: ImageNet Classification Leaderboard from paperswithcode.com">
<img data-src="imagenet_leaderboard.png" class="lazyload" alt="" width="100%" ></a>
<figcaption>
Fig 1: ImageNet Classification Leaderboard from <a href="https://paperswithcode.com">paperswithcode.com</a>
</figcaption>
</figure>
<p>Benchmarking has been proved to be beneficial for <strong>driving progress</strong>, identifying <strong>essential ideas</strong>, and solving domain-related problems in <a href="https://genomebiology.biomedcentral.com/articles/10.1186/s13059-019-1738-8">many</a> sub-fields of science. This project was conceived with this fundamental motivation.</p>
<hr>
<h3 id="need-of-a-benchmarking-framework-for-gnns">Need of a benchmarking framework for GNNs</h3>
<h4 id="a-datasets">a. Datasets:</h4>
<p>Many of the widely cited papers in the GNN literature contain experiments that are evaluated on <strong>small graph datasets</strong> which have only a few hundreds (or, thousand) of graphs.</p>
<figure>
<a data-fancybox="" href="tu_datasets.png" data-caption="Fig 2: Statistics of the widely used TU datasets. Source Errica et al., 2020">
<img data-src="tu_datasets.png" class="lazyload" alt="" width="100%" ></a>
<figcaption>
Fig 2: Statistics of the widely used TU datasets. Source <a href="https://openreview.net/forum?id=HygDF6NFPB">Errica et al., 2020</a>
</figcaption>
</figure>
<p><strong>Take for example</strong>, the ENZYMES dataset, which is almost seen in every work on a GNN for classification task. If one uses a random $10$-fold cross validation (in most papers), the test set would have $60$ graphs (i.e. $10$% of $600$ total graphs). That would mean a correct classification (or, alternatively a misclassification) would change $1.67$% of test accuracy score. <strong>A couple of samples could determine a $3.33$% difference in performance measure</strong>, which is usually a significant gain score stated when one validates a new idea in literature. You see there, the number of samples is unreliable to concretely acknowledge the advances. <sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<p>Our experiments, too, show that the standard deviation of performance on such datasets is large, making it difficult to make substantial conclusions on a research idea. Moreover, most GNNs perform statistically the same on these datasets.
The <strong>quality</strong> of these datasets also leads one to question if you should use them while validating ideas on GNNs. On several of these datasets, <a href="https://openreview.net/forum?id=HygDF6NFPB">simpler models</a>, sometimes, <a href="https://openreview.net/forum?id=rJlUhhVYvS">perform as good</a>, or even beats GNNs.</p>
<p>Consequently, <strong>it has become difficult</strong> to differentiate <a href="https://arxiv.org/abs/1905.09550">complex</a>, <a href="https://arxiv.org/abs/1905.04579">simple</a> and <a href="https://openreview.net/forum?id=HygDF6NFPB">graph-agnostic</a> architectures for graph machine learning.</p>
<!-- Most papers do not even use the same splits when comparing with an existing literature. -->
<h4 id="b-consistent-experimental-protocol">b. Consistent experimental protocol:</h4>
<p>Several papers in the GNN literature do not have consensus on a unifying and robust experimental setting which leads to <a href="https://arxiv.org/abs/1811.05868">discussing</a> the inconsistencies and <a href="https://openreview.net/forum?id=HygDF6NFPB">re-evaluating</a> several papers&rsquo; experiments.</p>
<p>For a couple of examples to highlight here, <a href="https://papers.nips.cc/paper/7729-hierarchical-graph-representation-learning-with-differentiable-pooling">Ying et al., 2018</a> performed training on $10$-fold split data for a fixed number of epochs and reported the performance of the epoch which has the <em>&ldquo;highest average validation accuracy across the splits at any epoch&rdquo;</em> whereas <a href="http://proceedings.mlr.press/v97/lee19c.html">Lee et al., 2019</a> used an <em>&ldquo;early stopping criterion&rdquo;</em> by monitoring the epoch-wise validation loss and report <em>&ldquo;average test accuracy at last epoch&rdquo;</em> over $10$-fold split.</p>
<p>Now, if we extract results of both these papers to put together in the same table and claim that the model with the highest performance score is the promising of all, <strong>can we get convinced</strong> that the comparison is fair?</p>
<blockquote>
<p>There are other issues related to hyperparamter selection, comparison in an unfair budgets of trainable paramters, use of different train-validation-test splits, etc.</p>
</blockquote>
<p>The existence of such problems pushed us to develop a GNN benchmarking framework which <strong>standardizes GNN research</strong> and help researchers make more meaningful advances.</p>
<hr>
<h3 id="challenges-of-building-a-gnn-benchmark">Challenges of building a GNN benchmark</h3>
<p>The lack of benchmarks have been a major issue in GNN literature as the <strong>aforementioned requirements have not been strictly enforced</strong>.</p>
<!-- We believe that a standard and unified benchmark framework should have --
1. an easy to use and reproducible coding framework
2. rigorous and fair experimental setting
3. appropriate datasets that can statistically separate model performance
4. comprehensive in terms of the fundamental tasks (applications) that the research can be applied to. -->
<p>Designing benchmarks is highly challenging as we must make robust decisions for coding framework, experimental settings and appropriate datasets. The benchmark should also be comprehensive to cover most of the fundamental tasks which is indicative of the application area the research can be applied to. For instance, graph learning problems include predicting properties at the node-level, edge-level and graph-level. A benchmark should attempt to cover many, if not all, of these.</p>
<p>Similarly, it is <strong>challenging to collect real and representative large-scale datasets</strong>. The lack of theoretical tools that can define the quality of a dataset or, validate its statistical representativeness for a given task makes it difficult to decide on datasets. Furthermore, there are arbitrary choices required on the features of nodes and edges for graphs and the scale of graph sizes as most of the popular graph learning frameworks do not cater <em>‘very efficiently’</em> to large graphs.</p>
<blockquote>
<p>There has been a promising effort recently, <a href="https://ogb.stanford.edu">The Open Graph Benchmark (OGB)</a>, to collect meaningful medium-to-large scale dataset in order to steer graph learning research. The initiative is complementary to the goals of this project.</p>
</blockquote>
<hr>
<h3 id="proposed-benchmarking-framework">Proposed benchmarking framework:</h3>
<!-- We include each of the four characteristics listed out in the previous section to propose a benchmarking framework. -->
<p>We propose a benchmarking framework for graph neural networks with the following key characteristics:</p>
<ol>
<li>We develop a modular coding infrastructure which can be used to speed up the development of new ideas</li>
<li>Our framework adopts a rigorous and fair experimental protocol,</li>
<li>We propose appropriate medium-scale datasets that can be used a plug-ins for later research. <sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></li>
</ol>
<ol start="4">
<li>Four fundamental tasks in graph machine learning are covered, i.e. graph classification, graph regression, node classification, and edge classification.</li>
</ol>
<h4 id="a-coding-infrastructure">a. Coding infrastructure:</h4>
<p>Our benchmarking code infrastructure is based on <a href="http://pytorch.org">Pytorch</a>/<a href="http://dgl.ai">DGL</a>.</p>
<p><strong>From a high-level view</strong>, our framework unifies independent components for i) Data pipelines, ii) GNN layers and models, iii Training and evaluation functions, iv) Network and hyperparameters configurations, and v) Single execution scripts for reproducibility.</p>
<figure>
<a data-fancybox="" href="coding_infrastructure.png" data-caption="Fig 3: Snapshot of our modular coding framework open-sourced on GitHub">
<img data-src="coding_infrastructure.png" class="lazyload" alt="" width="100%" ></a>
<figcaption>
Fig 3: Snapshot of our modular coding framework open-sourced on <a href="https://github.com/graphdeeplearning/benchmarking-gnns">GitHub</a>
</figcaption>
</figure>
<p>The detailed user instructions on use of each of these components is described on <a href="https://github.com/graphdeeplearning/benchmarking-gnns">GitHub README</a>. <sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup></p>
<hr>
<h4 id="b-datasets">b. Datasets:</h4>
<p>We include 8 datasets from diverse domains of chemistry, mathematical modeling, computer vision, combinatorial optimization and social networks.</p>
<figure>
<a data-fancybox="" href="dataset_summary.png" data-caption="Fig 4: Summary statistics of the datasets included in the proposed benchmark">
<img data-src="dataset_summary.png" class="lazyload" alt="" width="100%" ></a>
<figcaption>
Fig 4: Summary statistics of the datasets included in the proposed benchmark
</figcaption>
</figure>
<p>The steps for datasets&rsquo; preparation and their relevance to benchmarking graph neural networks are described in the paper.</p>
<blockquote>
<p>It is worth mentioning that we include <a href="https://ogb.stanford.edu/docs/linkprop/#ogbl-collab">OGBL-COLLAB</a> from OGB which demonstrates the we can <strong>flexibly incorporate</strong> any of the current and future datasets from the OGB initiative.</p>
</blockquote>
<!-- **Brief Description and Relevance**: ZINC is one of the most popular real-world molecular dataset of 250K graphs, out of which we select 12K for efficiency. The task is to regress a graph property of constrained solubility which is an important chemical property for designing generative molecules. PATTERN and CLUSTER are node classification datasets generated from Stochastic Block Models (SBMs), which are widely used to model communities in social networks. MNIST and CIFAR10 datasets are the superpixels graphs from the respective standard computer vision datasets. These datasets are important from a sanity-check perspective since we expect to perform close to 100% for MNIST and perform well enough for CIFAR10. TSP dataset is based on the traveling salesman problem, which is modeled for the edge classification task. The dataset is a collection of 2D Euclidean graphs where each graph is a TSP instance and the problem is to predict the edges that would form part of the optimal TSP tour. OGBL-COLLAB is a link prediction dataset from OGB, which is from a collaboration network dataset indexed by Microsoft Academic Graph. The task here is to predict authorship collaboration, i.e. link prediction between two authors represented by nodes. Finally, we include a small-scale dataset of Circular Skip Link Graphs. The CSL is a synthetic mathematical dataset used for the graph isomorphism problem and check expressivity of GNNs. Note that we include OGBL-COLLAB from OGB which demonstrates the we can flexibly incorporate any of the current and future datasets from the OGB initiative. -->
<hr>
<h4 id="c-experimental-protocol">c. Experimental Protocol:</h4>
<p>We define a rigorous and fair experimental protocol for benchmarking graph neural network models.</p>
<p><strong>Dataset splits:</strong> Given the literature has issues with using different train-val-test splits for different models, we make sure our data pipelines provide the same training, validation and test splits for every GNN model compared. We follow standard splits for the datasets available. For synthetic datasets with no standard splits, we ensure the class distribution or the synthetic properties are the same across the splits. Please refer to the paper on more details.</p>
<p><strong>Training:</strong> We use the same training setup and reporting protocol for all experiments. We use the Adam optimizer to train the GNNs with a learning rate decay strategy based on the validation loss. We train each experiment for an unspecified number of epochs where the model stops to train at a minimum learning rate at which there is no significant learning.</p>
<blockquote>
<p>Importantly, this strategy makes it easy for the users to not fathom on choosing how many epochs to train their model for.</p>
</blockquote>
<p>Each experiment is run on $4$ different seeds for a maximum of $12$ hours of training time and the summary statistics of the last epoch score of the $4$ experiments is reported.</p>
<p><strong>Parameter budget:</strong> We decide on using two trainable parameter budgets: (i) $100k$ parameters for each GNNs for all the tasks, and (ii) $500k$ parameters for GNNs for which we investigate scaling a model to larger parameters and deeper layers. The number of hidden layers and hidden dimensions are selected accordingly to match these budgets.</p>
<p>We make this choice of having a similar parameter budget for fair comparison because it becomes otherwise difficult to rigorously evaluate different models. In GNN literature, it is often seen the a new model is compared to the existing literature without any detail of the number of parameters, or any attempt to have the same size of the model. Having said that, our goal is not to find the optimal set of hyperparameters for each of the models which is a compute-intensive task.</p>
<hr>
<h4 id="d-graph-neural-networks">d. Graph Neural Networks:</h4>
<p>We benchmark two broad classes of GNNs that represent the categorical advances in the architectures of a graph neural network witnessed in the most recent literature. We call the two classes, for nomenclature, as <strong>GCNs (Graph Convolutional Networks)</strong> and <strong>WL-GNNs (Weisfeiler-Lehman GNNs)</strong>.</p>
<blockquote>
<p>GCNs refer to the popular message-passing based GNNs which leverage sparse tensor computation and WL-GNNs are the theoretically expressive GNNs based on the WL-test to distinguish non-isomorphic graphs which require dense tensor computation at each layer.</p>
</blockquote>
<p>Accordingly, our experimental pipeline is shown in Fig 5 for GCNs and Fig 6 for WL-GNNs.</p>
<p>
<figure>
<a data-fancybox="" href="mpgcns.png" data-caption="Fig 5: Our standard experimental pipeline for GCNs which operate on sparse rank-$2$ tensors.">
<img data-src="mpgcns.png" class="lazyload" alt="" width="100%" ></a>
<figcaption>
Fig 5: Our standard experimental pipeline for GCNs which operate on <em>sparse</em> rank-$2$ tensors.
</figcaption>
</figure>
<figure>
<a data-fancybox="" href="wlgnns.png" data-caption="Fig 6: Our standard experimental pipeline for WL-GNNs which operate on dense rank-$2$ tensors.">
<img data-src="wlgnns.png" class="lazyload" alt="" width="100%" ></a>
<figcaption>
Fig 6: Our standard experimental pipeline for WL-GNNs which operate on <em>dense</em> rank-$2$ tensors.
</figcaption>
</figure>
</p>
<p>We direct the readers to our paper and the corresponding works for more details on the mathematical formulations of the GNNs. To interested readers, we also include in paper the <strong>block diagrams of layer updates</strong> of each GNN benchmarked.</p>
<hr>
<div class="alert alert-note">
<div>
For a quick recap at this stage, we discussed the <strong>need of a benchmark</strong>, the <strong>challenges</strong> in building such a framework and <strong>details on our proposed benchmarking framework</strong>. We now delve into the experiments.
</div>
</div>
<p>We perform a principled investigation into the message passing based GCNs and the WL-GNNs to reveal important insights and highlight critical underlying challenges in building a powerful GNN model.</p>
<hr>
<h3 id="benchmarking-gnns-on-the-proposed-datasets">Benchmarking GNNs on the proposed datasets.</h3>
<p>We perform exhaustive experiments on all datasets using every GNN models included currently in our benchmarking framework. The experiments help us draw many insights, few of which are discussed here. We recommend reading the paper for details on the experimental results.</p>
<blockquote>
<p>The GNNs that we benchmark are: <a href="https://arxiv.org/abs/1609.02907"><em>Vanilla</em> Graph Convolutional Network (GCN)</a>, <a href="https://cs.stanford.edu/people/jure/pubs/graphsage-nips17.pdf">GraphSage</a>, <a href="https://arxiv.org/abs/1710.10903">Graph Attention Network (GAT)</a>, <a href="https://arxiv.org/abs/1611.08402">Gaussian Mixture Model (MoNet)</a>, <a href="https://arxiv.org/abs/1711.07553">GatedGCN</a>, <a href="https://arxiv.org/abs/1810.00826">Graph Isomorphism Network (GIN)</a>, <a href="https://papers.nips.cc/paper/9718-on-the-equivalence-between-graph-isomorphism-testing-and-function-approximation-with-gnns">RingGNN</a> and <a href="https://arxiv.org/abs/1905.11136">3WL-GNN</a>.</p>
</blockquote>
<p><strong>1. Graph-agnostic NNs perform poorly on the proposed datasets</strong>: We compare all GNNs to a simple MLP which updates each node’s features independent of one-another, i.e. ignoring the graph structure.</p>
<blockquote>
<p>MLP node update equation at layer $\ell$ is:
$$
h_{i}^{\ell+1} = \sigma \left( W^{\ell} \ h_{i}^{\ell} \right)
$$</p>
</blockquote>
<p>MLP evaluates to consistently low scores on each of the datasets which shows the necessity to consider graph structure for these tasks. This result is also indicative of how appropriate these datasets are for GNN research as they statistically separate model’s performance.</p>
<p><strong>2. GCNs outperform WL-GNNs on the proposed datasets</strong>: Although WL-GNNs are provably powerful in terms of graph isomorphism and expressiveness, the WL-GNN models that we consider were not able to outperform GCNs. These models are limited in scaling to larger datasets as their space/time complexity are inefficient as compared to the GCNs which leverage sparse tensors.</p>
<blockquote>
<p>GCNs are seen to conveniently scale to $16$ layers and provide the best results on all datasets, whereas the WL-GNNs face loss divergence and/or out-of-memory errors when trying to build deeper networks.</p>
</blockquote>
<p><strong>3. Anisotropic mechanisms improve message-passing GCNs architectures</strong>: Among the models in the message-passing GCNs, we can classify them into <strong>isotropic</strong> and <strong>anisotropic</strong>.</p>
<p>A GCN model whose node update equation treats every edge direction equally, is considered <strong>isotropic</strong>; and a GCN model whose node update equation treats every edge direction differently, is considered <strong>anisotropic</strong>.</p>
<blockquote>
<p>Isotropic layer update equation:
$$
h_{i}^{\ell+1} = \sigma \Big( W_1^{\ell} \ h_{i}^{\ell} + \sum_{j \in \mathcal{N}_i} W_2^{\ell} \ h_{j}^{\ell} \Big)
$$</p>
</blockquote>
<blockquote>
<p>Anisotropic layer update equation:
$$
h_{i}^{\ell+1} = \sigma \Big( W_1^{\ell} \ h_{i}^{\ell} + \sum_{j \in \mathcal{N}_i} \eta_{ij} W_2 h_{j}^{\ell} \Big)
$$</p>
</blockquote>
<p>As per the above equations, GCN, GraphSage and GIN are isotropic GCNs whereas GAT, MoNet and GatedGCN are anisotropic GCNs.</p>
<p>Our benchmark experiments reveal that the <strong>anisotropic mechanism is an architectural improvement</strong> in GCNs which give consistently impressive results. Note that sparse and dense attention mechanisms (in GAT and GatedGCN respectively) are examples anisotropic components in a GNN.</p>
<p><strong>4. There are underlying challenges for training the theoretically powerful WL-GNNs</strong>: We observe a high standard deviation of performance scores on the WL-GNNs. (Recall that we report every performance of 4 runs with different seeds). This reveals <strong>the problem in training</strong> these models.</p>
<p>Universal training procedures like batched training and batch normalization are not used in WL-GNNs since they operate on dense rank-2 tensors.</p>
<p>To describe this clearly, the batching approach for GCNs in leading graph machine learning libraries which operate on sparse rank-2 tensors involves preparing a <strong>sparse block diagonal adjacency matrix</strong> for a batch of graphs.</p>
<figure>
<a data-fancybox="" href="batching.png" data-caption="Fig 7: Mini-batch graph represented with one sparse block-diagonal matrix. Source">
<img data-src="batching.png" class="lazyload" alt="" width="100%" ></a>
<figcaption>
Fig 7: Mini-batch graph represented with one sparse block-diagonal matrix. <a href="https://github.com/tkipf/gcn#graph-classification">Source</a>
</figcaption>
</figure>
<p>The WL-GNNs that operate on dense rank-2 tensors, have components which compute information at/from every position in the dense tensor. Therefore, the same approach (Fig 7) is not applicable as it would make the entire block diagonal matrix dense and would break sparsity.</p>
<p>GCNs leverage batched training and hence batch normalization for stable and fast training. Besides, WL-GNNs, with the current design, are not suitable for single large graphs, eg. OGBL-COLLAB. We failed to fit the dense tensor of this large size on both GPU and CPU memory.</p>
<p>Hence, our benchmark suggests the need for <strong>re-thinking</strong> better design approaches for WL-GNNs which can leverage sparsity, batching, normalization schemes, etc. that have become universal ingredients in deep learning.</p>
<!-- **5. 3WL-GNNs perform the best among their class**: Among the models in the WL-GNN class, 3WL-GNN provides better results than its similar counterpart RingGNN. 3WL-GNN is the most theoretically powerful model of all the GNNs currently considered in our benchmarking framework. It is as powerful as 3-WL for isomorphism. The GIN models while being less expressive is able to scale better and provides overall good performance. -->
<hr>
<h3 id="more-reading">More reading</h3>
<p>With this introduction and usefulness of a GNN benchmarking framework, we conlcude this blog post, but there is more reading left if you&rsquo;re interested in this work.</p>
<p><strong>Particularly</strong>, we investigate anisotropy and edge representations for link prediction in more detail in the paper and propose a new approach for improving low-structurally expressive GCNs. <em>We shall discuss these in future blog posts separately for clear understanding</em>.</p>
<p>If this benchmarking framework comes to use in your research, please use the following bibtex in your work. For discussions, hit us with a query on <a href="https://github.com/graphdeeplearning/benchmarking-gnns/issues">GitHub Issues</a>. We would love to discuss and improve the benchmark for steering more meaningful research in graph neural networks.</p>
<pre><code>@article{dwivedi2020benchmarkgnns,
title={Benchmarking Graph Neural Networks},
author={Dwivedi, Vijay Prakash and Joshi, Chaitanya K and Laurent, Thomas and Bengio, Yoshua and Bresson, Xavier},
journal={arXiv preprint arXiv:2003.00982},
year={2020}
}
</code></pre>
<section class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1" role="doc-endnote">
<p>By this, we do not mean the ideas are not useful and/or the work put by the authors is not meaningful. Every effort equally contributes to the advance of this field. <a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2" role="doc-endnote">
<p>As examples, you may refer <a href="https://arxiv.org/pdf/2006.07846.pdf">to</a> <a href="https://github.com/lukecavabarrett/pna">these</a> <a href="https://github.com/AITRICS/mol_reliable_gnn">works</a> that leverage our framework to conveniently work on their research idea. It indicates the effectiveness of having such a framework. <a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3" role="doc-endnote">
<p>Note that we do not aim to develop a software library, but to come up with a coding framework where each component is simple and transparent to as many users as possible. <a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</section>
</description>
</item>
<item>
<title>Learning TSP Requires Rethinking Generalization</title>
<link>https://graphdeeplearning.github.io/publication/joshi-2020-learning/</link>
<pubDate>Fri, 12 Jun 2020 00:00:00 +0000</pubDate>
<guid>https://graphdeeplearning.github.io/publication/joshi-2020-learning/</guid>
<description></description>
</item>
<item>
<title>Benchmarking Graph Neural Networks</title>
<link>https://graphdeeplearning.github.io/project/benchmark/</link>
<pubDate>Tue, 03 Mar 2020 22:20:35 +0800</pubDate>
<guid>https://graphdeeplearning.github.io/project/benchmark/</guid>
<description></description>
</item>
<item>
<title>Benchmarking Graph Neural Networks</title>
<link>https://graphdeeplearning.github.io/publication/dwivedi-2020-benchmark/</link>
<pubDate>Mon, 02 Mar 2020 00:00:00 +0000</pubDate>
<guid>https://graphdeeplearning.github.io/publication/dwivedi-2020-benchmark/</guid>
<description></description>
</item>
<item>
<title>Transformers are Graph Neural Networks</title>
<link>https://graphdeeplearning.github.io/post/transformers-are-gnns/</link>
<pubDate>Wed, 12 Feb 2020 16:08:39 +0800</pubDate>
<guid>https://graphdeeplearning.github.io/post/transformers-are-gnns/</guid>
<description><p>Engineer friends often ask me: Graph Deep Learning sounds great, but are there any big commercial success stories? Is it being deployed in practical applications?</p>
<p>Besides the obvious ones&ndash;recommendation systems at <a href="https://medium.com/pinterest-engineering/pinsage-a-new-graph-convolutional-neural-network-for-web-scale-recommender-systems-88795a107f48">Pinterest</a>, <a href="https://arxiv.org/abs/1902.08730">Alibaba</a> and <a href="https://blog.twitter.com/en_us/topics/company/2019/Twitter-acquires-Fabula-AI.html">Twitter</a>&ndash;a slightly nuanced success story is the <a href="https://arxiv.org/abs/1706.03762"><strong>Transformer architecture</strong></a>, which has <a href="https://openai.com/blog/better-language-models/">taken</a> <a href="https://www.blog.google/products/search/search-language-understanding-bert/">the</a> <a href="https://www.microsoft.com/en-us/research/project/large-scale-pretraining-for-response-generation/">NLP</a> <a href="https://ai.facebook.com/blog/roberta-an-optimized-method-for-pretraining-self-supervised-nlp-systems/">industry</a> <a href="https://blog.einstein.ai/introducing-a-conditional-transformer-language-model-for-controllable-generation/">by</a> <a href="https://nv-adlr.github.io/MegatronLM">storm</a>.</p>
<p>Through this post, I want to establish links between <a href="https://graphdeeplearning.github.io/project/spatial-convnets/">Graph Neural Networks (GNNs)</a> and Transformers.
I&rsquo;ll talk about the intuitions behind model architectures in the NLP and GNN communities, make connections using equations and figures, and discuss how we could work together to drive progress.</p>
<p>Let&rsquo;s start by talking about the purpose of model architectures&ndash;<em>representation learning</em>.</p>
<hr>
<h3 id="representation-learning-for-nlp">Representation Learning for NLP</h3>
<p>At a high level, all neural network architectures build <em>representations</em> of input data as vectors/embeddings, which encode useful statistical and semantic information about the data.
These <em>latent</em> or <em>hidden</em> representations can then be used for performing something useful, such as classifying an image or translating a sentence.
The neural network <em>learns</em> to build better-and-better representations by receiving feedback, usually via error/loss functions.</p>
<p>For Natural Language Processing (NLP), conventionally, <strong>Recurrent Neural Networks</strong> (RNNs) build representations of each word in a sentence in a sequential manner, <em>i.e.</em>, <strong>one word at a time</strong>.
Intuitively, we can imagine an RNN layer as a conveyor belt, with the words being processed on it <em>autoregressively</em> from left to right.
At the end, we get a hidden feature for each word in the sentence, which we pass to the next RNN layer or use for our NLP tasks of choice.</p>
<blockquote>
<p>I highly recommend Chris Olah&rsquo;s legendary blog for recaps on <a href="http://colah.github.io/posts/2015-08-Understanding-LSTMs/">RNNs</a> and <a href="http://colah.github.io/posts/2014-07-NLP-RNNs-Representations/">representation learning</a> for NLP.</p>
</blockquote>
<figure>
<a data-fancybox="" href="rnn-transf-nlp.jpg" >
<img data-src="rnn-transf-nlp.jpg" class="lazyload" alt="" width="100%" ></a>
</figure>
<p>Initially introduced for machine translation, <strong>Transformers</strong> have gradually replaced RNNs in mainstream NLP.
The architecture takes a fresh approach to representation learning: Doing away with recurrence entirely, Transformers build features of each word using an <a href="https://distill.pub/2016/augmented-rnns/">attention</a> <a href="https://lilianweng.github.io/lil-log/2018/06/24/attention-attention.html">mechanism</a> to figure out how important <strong>all the other words</strong> in the sentence are w.r.t. to the aforementioned word.
Knowing this, the word&rsquo;s updated features are simply the sum of linear transformations of the features of all the words, weighted by their importance.</p>
<blockquote>
<p>Back in 2017, this idea sounded very radical, because the NLP community was so used to the sequential&ndash;one-word-at-a-time&ndash;style of processing text with RNNs. The title of the paper probably added fuel to the fire!</p>
<p>For a recap, Yannic Kilcher made an excellent <a href="https://www.youtube.com/watch?v=iDulhoQ2pro">video overview</a>.</p>
</blockquote>
<hr>
<h3 id="breaking-down-the-transformer">Breaking down the Transformer</h3>
<p>Let&rsquo;s develop intuitions about the architecture by translating the previous paragraph into the language of mathematical symbols and vectors.
We update the hidden feature $h$ of the $i$'th word in a sentence $\mathcal{S}$ from layer $\ell$ to layer $\ell+1$ as follows:</p>
<p>$$
h_{i}^{\ell+1} = \text{Attention} \left( Q^{\ell} h_{i}^{\ell} \ , K^{\ell} h_{j}^{\ell} \ , V^{\ell} h_{j}^{\ell} \right),
$$</p>
<p>$$
i.e.,\ h_{i}^{\ell+1} = \sum_{j \in \mathcal{S}} w_{ij} \left( V^{\ell} h_{j}^{\ell} \right),
$$</p>
<p>$$
\text{where} \ w_{ij} = \text{softmax}_j \left( Q^{\ell} h_{i}^{\ell} \cdot K^{\ell} h_{j}^{\ell} \right),
$$</p>
<p>where $j \in \mathcal{S}$ denotes the set of words in the sentence and $Q^{\ell}, K^{\ell}, V^{\ell}$ are learnable linear weights (denoting the <strong>Q</strong>uery, <strong>K</strong>ey and <strong>V</strong>alue for the attention computation, respectively).
The attention mechanism is performed parallelly for each word in the sentence to obtain their updated features in <em>one shot</em>&ndash;another plus point for Transformers over RNNs, which update features word-by-word.</p>
<p>We can understand the attention mechanism better through the following pipeline:</p>
<figure>
<a data-fancybox="" href="attention-block.jpg" >
<img data-src="attention-block.jpg" class="lazyload" alt="" width="50%" ></a>
</figure>
<blockquote>
<p>Taking in the features of the word $h_{i}^{\ell}$ and the set of other words in the sentence ${ h_{j}^{\ell} ;\ \forall j \in \mathcal{S} }$, we compute the attention weights $w_{ij}$ for each pair $(i,j)$ through the dot-product, followed by a softmax across all $j$'s. Finally, we produce the updated word feature $h_{i}^{\ell+1}$ for word $i$ by summing over all ${ h_{j}^{\ell} }$'s weighted by their corresponding $w_{ij}$. Each word in the sentence parallelly undergoes the same pipeline to update its features.</p>
</blockquote>
<hr>
<h3 id="multi-head-attention-mechanism">Multi-head Attention mechanism</h3>
<p>Getting this dot-product attention mechanism to work proves to be tricky&ndash;bad random initializations can de-stabilize the learning process.
We can overcome this by parallelly performing multiple &lsquo;heads&rsquo; of attention and concatenating the result (with each head now having separate learnable weights):</p>
<p>$$
h_{i}^{\ell+1} = \text{Concat} \left( \text{head}_1, \ldots, \text{head}_K \right) O^{\ell},
$$
$$
\text{head}_k = \text{Attention} \left( Q^{k,\ell} h_{i}^{\ell} \ , K^{k, \ell} h_{j}^{\ell} \ , V^{k, \ell} h_{j}^{\ell} \right),
$$</p>
<p>where $Q^{k,\ell}, K^{k,\ell}, V^{k,\ell}$ are the learnable weights of the $k$'th attention head and $O^{\ell}$ is a down-projection to match the dimensions of $h_i^{\ell+1}$ and $h_i^{\ell}$ across layers.</p>
<p>Multiple heads allow the attention mechanism to essentially &lsquo;hedge its bets&rsquo;, looking at different transformations or aspects of the hidden features from the previous layer.
We&rsquo;ll talk more about this later.</p>
<hr>
<h3 id="scale-issues-and-the-feed-forward-sub-layer">Scale issues and the Feed-forward sub-layer</h3>
<p>A key issue motivating the final Transformer architecture is that the features for words <em>after</em> the attention mechanism might be at <strong>different scales</strong> or <strong>magnitudes</strong>:
(1) This can be due to some words having very sharp or very distributed attention weights $w_{ij}$ when summing over the features of the other words.
(2) At the individual feature/vector entries level, concatenating across multiple attention heads&ndash;each of which might output values at different scales&ndash;can lead to the entries of the final vector $h_{i}^{\ell+1}$ having a wide range of values.
Following conventional ML wisdom, it seems reasonable to add a <a href="https://nealjean.com/ml/neural-network-normalization/">normalization layer</a> into the pipeline.</p>
<p>Transformers overcome issue (2) with <a href="https://arxiv.org/abs/1607.06450"><strong>LayerNorm</strong></a>, which normalizes and learns an affine transformation at the feature level.
Additionally, <strong>scaling the dot-product</strong> attention by the square-root of the feature dimension helps counteract issue (1).</p>
<p>Finally, the authors propose another &lsquo;trick&rsquo; to control the scale issue: <strong>a position-wise 2-layer MLP</strong> with a special structure.
After the multi-head attention, they project $h_i^{\ell+1}$ to a (absurdly) higher dimension by a learnable weight, where it undergoes the ReLU non-linearity, and is then projected back to its original dimension followed by another normalization:</p>
<p>$$
h_i^{\ell+1} = \text{LN} \left( \text{MLP} \left( \text{LN} \left( h_i^{\ell+1} \right) \right) \right)
$$</p>
<blockquote>
<p>To be honest, I&rsquo;m not sure what the exact intuition behind the over-parameterized feed-forward sub-layer was and nobody seems to be asking questions about it, too! I suppose LayerNorm and scaled dot-products didn&rsquo;t completely solve the issues highlighted, so the big MLP is a sort of hack to re-scale the feature vectors independently of each other.</p>
<p><a href="mailto:[email protected]">Email me</a> if you know more!</p>
</blockquote>
<hr>
<p>The final picture of a Transformer layer looks like this:</p>
<figure>
<a data-fancybox="" href="transformer-block.png" >
<img data-src="transformer-block.png" class="lazyload" alt="" width="60%" ></a>
</figure>
<p>The Transformer architecture is also extremely amenable to very deep networks, enabling the NLP community to <em><a href="https://arxiv.org/abs/1910.10683">scale</a> <a href="https://arxiv.org/abs/2001.08361">up</a></em> in terms of both model parameters and, by extension, data.
<strong>Residual connections</strong> between the inputs and outputs of each multi-head attention sub-layer and the feed-forward sub-layer are key for stacking Transformer layers (but omitted from the diagram for clarity).</p>
<hr>
<h3 id="gnns-build-representations-of-graphs">GNNs build representations of graphs</h3>
<p>Let&rsquo;s take a step away from NLP for a moment.</p>
<p>Graph Neural Networks (GNNs) or Graph Convolutional Networks (GCNs) build representations of nodes and edges in graph data.
They do so through <strong>neighbourhood aggregation</strong> (or message passing), where each node gathers features from its neighbours to update its representation of the <em>local</em> graph structure around it.
Stacking several GNN layers enables the model to propagate each node&rsquo;s features over the entire graph&ndash;from its neighbours to the neighbours&rsquo; neighbours, and so on.</p>
<figure>
<a data-fancybox="" href="gnn-social-network.jpg" >
<img data-src="gnn-social-network.jpg" class="lazyload" alt="" width="100%" ></a>
</figure>
<blockquote>
<p>Take the example of this emoji social network: The node features produced by the GNN can be used for predictive tasks such as identifying the most influential members or proposing potential connections.</p>
</blockquote>
<p>In their most basic form, GNNs update the hidden features $h$ of node $i$ (for example, 😆) at layer $\ell$ via a non-linear transformation of the node&rsquo;s own features $h_i^{\ell}$ added to the aggregation of features $h_j^{\ell}$ from each neighbouring node $j \in \mathcal{N}(i)$:</p>
<p>$$
h_{i}^{\ell+1} = \sigma \Big( U^{\ell} h_{i}^{\ell} + \sum_{j \in \mathcal{N}(i)} \left( V^{\ell} h_{j}^{\ell} \right) \Big),
$$</p>
<p>where $U^{\ell}, V^{\ell}$ are learnable weight matrices of the GNN layer and $\sigma$ is a non-linearity such as ReLU.
In the example, $\mathcal{N}$(😆) $=$ { 😘, 😎, 😜, 🤩 }.</p>
<p>The summation over the neighbourhood nodes $j \in \mathcal{N}(i)$ can be replaced by other input size-invariant <strong>aggregation functions</strong> such as simple mean/max or something more powerful, such as a weighted sum via an <a href="https://petar-v.com/GAT/"><strong>attention mechanism</strong></a>.</p>
<p>Does that sound familiar?</p>
<p>Maybe a pipeline will help make the connection:</p>
<figure>
<a data-fancybox="" href="gnn-block.jpg" >
<img data-src="gnn-block.jpg" class="lazyload" alt="" width="50%" ></a>
</figure>
<div class="alert alert-note">
<div>
If we were to do multiple parallel heads of neighbourhood aggregation and replace summation over the neighbours $j$ with the attention mechanism, <em>i.e.</em>, a weighted sum, we&rsquo;d get the <b>Graph Attention Network</b> (GAT). Add normalization and the feed-forward MLP, and voila, we have a <b>Graph Transformer</b>!
</div>
</div>
<hr>
<h3 id="sentences-are-fully-connected-word-graphs">Sentences are fully-connected word graphs</h3>
<p>To make the connection more explicit, consider a sentence as a fully-connected graph, where each word is connected to every other word.
Now, we can use a GNN to build features for each node (word) in the graph (sentence), which we can then perform NLP tasks with.</p>
<figure>
<a data-fancybox="" href="gnn-nlp.jpg" >
<img data-src="gnn-nlp.jpg" class="lazyload" alt="" width="90%" ></a>
</figure>
<p>Broadly, this is what Transformers are doing: they are <strong>GNNs with multi-head attention</strong> as the neighbourhood aggregation function.
Whereas standard GNNs aggregate features from their local neighbourhood nodes $j \in \mathcal{N}(i)$,
Transformers for NLP treat the entire sentence $\mathcal{S}$ as the local neighbourhood, aggregating features from each word $j \in \mathcal{S}$ at each layer.</p>
<p>Importantly, various problem-specific tricks&ndash;such as position encodings, causal/masked aggregation, learning rate schedules and extensive pre-training&ndash;are essential for the success of Transformers but seldom seem in the GNN community.
At the same time, looking at Transformers from a GNN perspective could inspire us to get rid of a lot of the <em>bells and whistles</em> in the architecture.</p>
<hr>
<h3 id="what-can-we-learn-from-each-other">What can we learn from each other?</h3>
<p>Now that we&rsquo;ve established a connection between Transformers and GNNs, let me throw some ideas around&hellip;</p>
<h4 id="are-fully-connected-graphs-the-best-input-format-for-nlp">Are fully-connected graphs the best input format for NLP?</h4>
<p>Before statistical NLP and ML, linguists like Noam Chomsky focused on developing fomal theories of <a href="https://en.wikipedia.org/wiki/Syntactic_Structures">linguistic structure</a>, such as <strong>syntax trees/graphs</strong>.
<a href="https://arxiv.org/abs/1503.00075">Tree LSTMs</a> already tried this, but maybe Transformers/GNNs are better architectures for bringing the world of linguistic theory and statistical NLP closer?</p>
<figure>
<a data-fancybox="" href="syntax-tree.png" >
<img data-src="syntax-tree.png" class="lazyload" alt="" width="40%" ></a>
</figure>
<h4 id="how-to-learn-long-term-dependencies">How to learn long-term dependencies?</h4>
<p>Another issue with fully-connected graphs is that they make learning very long-term dependencies between words difficult.
This is simply due to how the number of edges in the graph <strong>scales quadratically</strong> with the number of nodes, <em>i.e.</em>, in an $n$ word sentence, a Transformer/GNN would be doing computations over $n^2$ pairs of words. Things get out of hand for very large $n$.</p>
<p>The NLP community&rsquo;s perspective on the long sequences and dependencies problem is interesting:
Making the attention mechanism <a href="https://openai.com/blog/sparse-transformer/">sparse</a> or <a href="https://ai.facebook.com/blog/making-transformer-networks-simpler-and-more-efficient/">adaptive</a> in terms of input size, adding <a href="https://ai.googleblog.com/2019/01/transformer-xl-unleashing-potential-of.html">recurrence</a> or <a href="https://deepmind.com/blog/article/A_new_model_and_dataset_for_long-range_memory">compression</a> into each layer,
and using <a href="https://www.pragmatic.ml/reformer-deep-dive/">Locality Sensitive Hashing</a> for efficient attention
are all promising new ideas for better Transformers.</p>
<p>It would be interesting to see ideas from the GNN community thrown into the mix, <em>e.g.</em>, <a href="https://arxiv.org/abs/1911.04070">Binary Partitioning</a> for sentence <strong>graph sparsification</strong> seems like another exciting approach.</p>
<figure>
<a data-fancybox="" href="long-term-depend.png" >
<img data-src="long-term-depend.png" class="lazyload" alt="" width="80%" ></a>
</figure>
<h4 id="are-transformers-learning-neural-syntax">Are Transformers learning &lsquo;neural syntax&rsquo;?</h4>
<p>There have been <a href="https://pair-code.github.io/interpretability/bert-tree/">several</a> <a href="https://arxiv.org/abs/1905.05950">interesting</a> <a href="https://arxiv.org/abs/1906.04341">papers</a> from the NLP community on what Transformers might be learning.
The basic premise is that performing attention on all word pairs in a sentence&ndash;with the purpose of identifying which pairs are the most interesting&ndash;enables Transformers to learn something like a <strong>task-specific syntax</strong>.
Different heads in the multi-head attention might also be &lsquo;looking&rsquo; at different syntactic properties.</p>
<p>In graph terms, by using GNNs on full graphs, can we recover the most important edges&ndash;and what they might entail&ndash;from how the GNN performs neighbourhood aggregation at each layer?
I&rsquo;m <a href="https://arxiv.org/abs/1909.07913">not so convinced</a> by this view yet.</p>
<figure>
<a data-fancybox="" href="attention-heads.png" >
<img data-src="attention-heads.png" class="lazyload" alt="" width="100%" ></a>
</figure>
<h4 id="why-multiple-heads-of-attention-why-attention">Why multiple heads of attention? Why attention?</h4>
<p>I&rsquo;m more sympathetic to the optimization view of the multi-head mechanism&ndash;having multiple attention heads <strong>improves learning</strong> and overcomes <strong>bad random initializations</strong>.
For instance, <a href="https://lena-voita.github.io/posts/acl19_heads.html">these</a> <a href="https://arxiv.org/abs/1905.10650">papers</a> showed that Transformer heads can be &lsquo;pruned&rsquo; or removed <em>after</em> training without significant performance impact.</p>
<p>Multi-head neighbourhood aggregation mechanisms have also proven effective in GNNs, <em>e.g.</em>, GAT uses the same multi-head attention and <a href="https://arxiv.org/abs/1611.08402">MoNet</a> uses multiple <em>Gaussian kernels</em> for aggregating features.
Although invented to stabilize attention mechanisms, could the multi-head trick become standard for squeezing out extra model performance?</p>
<p>Conversely, GNNs with simpler aggregation functions such as sum or max do not require multiple aggregation heads for stable training.
Wouldn&rsquo;t it be nice for Transformers if we didn&rsquo;t have to compute pair-wise compatibilities between each word pair in the sentence?</p>
<p>Could Transformers benefit from ditching attention, altogether? Yann Dauphin and collaborators&rsquo; <a href="https://arxiv.org/abs/1705.03122">recent</a> <a href="https://arxiv.org/abs/1901.10430">work</a> suggests an alternative <strong>ConvNet architecture</strong>.
Transformers, too, might ultimately be doing <a href="http://jbcordonnier.com/posts/attention-cnn/">something</a> <a href="https://twitter.com/ChrSzegedy/status/1232148457810538496">similar</a> to ConvNets!</p>
<figure>
<a data-fancybox="" href="attention-conv.png" >
<img data-src="attention-conv.png" class="lazyload" alt="" width="100%" ></a>
</figure>
<h4 id="why-is-training-transformers-so-hard">Why is training Transformers so hard?</h4>
<p>Reading new Transformer papers makes me feel that training these models requires something akin to <em>black magic</em> when determining the best <strong>learning rate schedule, warmup strategy</strong> and <strong>decay settings</strong>.
This could simply be because the models are so huge and the NLP tasks studied are so challenging.</p>
<p>But <a href="https://arxiv.org/abs/1906.01787">recent</a> <a href="https://arxiv.org/abs/1910.06764">results</a> <a href="https://arxiv.org/abs/2002.04745">suggest</a> that it could also be due to the specific permutation of normalization and residual connections within the architecture.</p>
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">I enjoyed reading the new <a href="https://twitter.com/DeepMind?ref_src=twsrc%5Etfw">@DeepMind</a> Transformer paper, but why is training these models such dark magic? &quot;For word-based LM we used 16, 000 warmup steps with 500, 000 decay steps and sacrifice 9,000 goats.&quot;<a href="https://t.co/dP49GTa4ze">https://t.co/dP49GTa4ze</a> <a href="https://t.co/1K3Fx4s3M8">pic.twitter.com/1K3Fx4s3M8</a></p>&mdash; Chaitanya Joshi (@chaitjo) <a href="https://twitter.com/chaitjo/status/1229335421806501888?ref_src=twsrc%5Etfw">February 17, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<p>At this point I&rsquo;m ranting, but this makes me sceptical: Do we really need multiple heads of expensive pair-wise attention, overparameterized MLP sub-layers, and complicated learning schedules?</p>
<p>Do we really need massive models with <a href="https://www.technologyreview.com/s/613630/training-a-single-ai-model-can-emit-as-much-carbon-as-five-cars-in-their-lifetimes/">massive carbon footprints</a>?</p>
<p>Shouldn&rsquo;t architectures with good <a href="https://arxiv.org/abs/1806.01261">inductive biases</a> for the task at hand be easier to train?</p>
<hr>
<h3 id="further-reading">Further Reading</h3>
<p>To dive deep into the Transformer architecture from an NLP perspective, check out these amazing blog posts: <a href="http://jalammar.github.io/illustrated-transformer/">The Illustrated Transformer</a> and <a href="http://nlp.seas.harvard.edu/2018/04/03/attention.html">The Annotated Transformer</a>.</p>
<p>Also, this blog isn&rsquo;t the first to link GNNs and Transformers:
Here&rsquo;s <a href="https://ipam.wistia.com/medias/1zgl4lq6nh">an excellent talk</a> by Arthur Szlam on the history and connection between Attention/Memory Networks, GNNs and Transformers.
Similarly, DeepMind&rsquo;s <a href="https://arxiv.org/abs/1806.01261">star-studded position paper</a> introduces the <em>Graph Networks</em> framework, unifying all these ideas.
For a code walkthrough, the DGL team has <a href="https://docs.dgl.ai/en/latest/tutorials/models/4_old_wines/7_transformer.html">a nice tutorial</a> on seq2seq as a graph problem and building Transformers as GNNs.</p>
<p><strong>In our next post, we&rsquo;ll be doing the reverse: using GNN architectures as Transformers for NLP (based on the Transformers library by <a href="https://github.com/huggingface/transformers">🤗 HuggingFace</a>).</strong></p>
<p>Finally, we wrote <a href="https://graphdeeplearning.github.io/publication/xu-2019-multi/">a recent paper</a> applying Transformers to sketch graphs. Do check it out!</p>
<hr>
<h4 id="updates">Updates</h4>
<p>The post is also available on <a href="https://medium.com/@chaitjo/transformers-are-graph-neural-networks-bca9f75412aa?source=friends_link&amp;sk=c54de873b2cec3db70166a6cf0b41d3e">Medium</a>, and has been translated to <a href="https://mp.weixin.qq.com/s/DABEcNf1hHahlZFMttiT2g">Chinese</a> and <a href="https://habr.com/ru/post/491576/">Russian</a>.
Do join the discussion on <a href="https://twitter.com/chaitjo/status/1233220586358181888?s=20">Twitter</a>, <a href="https://www.reddit.com/r/MachineLearning/comments/fb86mo/d_transformers_are_graph_neural_networks_blog/">Reddit</a> or <a href="https://news.ycombinator.com/item?id=22518263">HackerNews</a>!</p>
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Transformers are a special case of Graph Neural Networks. This may be obvious to some, but the following blog post does a good job at explaining these important concepts. <a href="https://t.co/H8LT2F7LqC">https://t.co/H8LT2F7LqC</a></p>&mdash; Oriol Vinyals (@OriolVinyalsML) <a href="https://twitter.com/OriolVinyalsML/status/1233783593626951681?ref_src=twsrc%5Etfw">February 29, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</description>
</item>
<item>
<title>Free-hand Sketches</title>
<link>https://graphdeeplearning.github.io/project/sketches/</link>
<pubDate>Tue, 14 Jan 2020 16:19:27 +0800</pubDate>
<guid>https://graphdeeplearning.github.io/project/sketches/</guid>
<description><h2 id="representation-learning-for-sketches">Representation Learning for Sketches</h2>
<p>Human beings have been creating free-hand sketches, <em>i.e.</em>, drawings without precise instruments, since <a href="https://en.wikipedia.org/wiki/Cave_painting">time immemorial</a>.
Due to the popularity of touchscreen interfaces, machine learning using sketches has emerged as an interesting problem with a myriad of applications:
If we consider sketches as 2D images, we can throw them into off-the-shelf <a href="https://arxiv.org/abs/1501.07873">Convolutional Neural Networks (CNNs)</a>.
While CNNs are designed for <em>static</em> collections of pixels with <em>dense</em> colors and textures,
sketches are usually an extremely <em>sparse</em> sequences of strokes which capture high-level abstractions and ideas. <a href="https://ai.googleblog.com/2017/04/teaching-machines-to-draw.html">Recurrent Neural Networks (RNNs)</a> stick out as a natural architecture for capturing this temporal nature of sketches.</p>
<blockquote>
<p><em>Structure vs. temporal order: can we have the best of both worlds?</em></p>
</blockquote>
<h2 id="sketches-as-graphs">Sketches as Graphs</h2>
<p>We are working on a novel representation of free-hand sketches as <strong>sparsely-connected graphs</strong>.
We assume that sketches are sets of curves and strokes, which are discretized by a set of points representing the graph nodes.
Each node encodes spatial, temporal and semantic information.
Thus, representing sketches with graphs offers a universal representation that can make use of both the sketch structure (like images) as well as temporal information (like stroke sequences).
To exploit these graph structures, we are developing <strong>Graph Neural Networks (GNNs)</strong> based on the Transformer model <a href="https://arxiv.org/abs/1706.03762">[<em>Vaswani et al.</em>, 2017]</a>.</p>
</description>
</item>
<item>
<title>Multi-Graph Transformer for Free-Hand Sketch Recognition</title>
<link>https://graphdeeplearning.github.io/publication/xu-2019-multi/</link>
<pubDate>Tue, 24 Dec 2019 00:00:00 +0000</pubDate>
<guid>https://graphdeeplearning.github.io/publication/xu-2019-multi/</guid>
<description></description>
</item>
<item>
<title>A Two-Step Graph Convolutional Decoder for Molecule Generation</title>
<link>https://graphdeeplearning.github.io/publication/bresson-2019-two/</link>
<pubDate>Sun, 01 Dec 2019 00:00:00 +0000</pubDate>
<guid>https://graphdeeplearning.github.io/publication/bresson-2019-two/</guid>
<description></description>
</item>
<item>
<title>On Learning Paradigms for the Travelling Salesman Problem</title>
<link>https://graphdeeplearning.github.io/publication/joshi-2019-learning/</link>
<pubDate>Sun, 01 Dec 2019 00:00:00 +0000</pubDate>
<guid>https://graphdeeplearning.github.io/publication/joshi-2019-learning/</guid>
<description></description>
</item>
<item>
<title>Graph Neural Networks for the Travelling Salesman Problem</title>
<link>https://graphdeeplearning.github.io/talk/informs-oct2019/</link>
<pubDate>Tue, 22 Oct 2019 00:00:00 +0000</pubDate>
<guid>https://graphdeeplearning.github.io/talk/informs-oct2019/</guid>
<description></description>
</item>
<item>
<title>Graph Convolutional Neural Networks for Molecule Generation</title>
<link>https://graphdeeplearning.github.io/talk/ipam-sept2019/</link>
<pubDate>Mon, 23 Sep 2019 00:00:00 +0000</pubDate>
<guid>https://graphdeeplearning.github.io/talk/ipam-sept2019/</guid>
<description></description>
</item>
<item>
<title>Combinatorial Optimization</title>
<link>https://graphdeeplearning.github.io/project/combinatorial-optimization/</link>
<pubDate>Tue, 17 Sep 2019 22:20:35 +0800</pubDate>
<guid>https://graphdeeplearning.github.io/project/combinatorial-optimization/</guid>
<description><h2 id="operations-research-and-combinatorial-problems">Operations Research and Combinatorial Problems</h2>
<p><strong><a href="https://en.wikipedia.org/wiki/Operations_research">Operations Research (OR)</a></strong> started in the first world war as an initiative to use mathematics and computer science to assist military planners in their decisions.
Today, combinatorial optimization algorithms developed in the OR community form the backbone of the most important modern industries including transportation, logistics, scheduling, finance and supply chains.</p>
<p>OR Problems are formulated as integer constrained optimization, <em>i.e.</em>, with integral or binary variables (called decision variables).
While not all such problems are hard to solve (<em>e.g.</em>, finding the shortest path between two locations), we concentrate on <strong><a href="https://en.wikipedia.org/wiki/Combinatorial_optimization">Combinatorial (NP-Hard) problems</a></strong>.
NP-Hard problems are <em>impossible</em> to solve optimally at large scales as exhaustively searching for their solutions is beyond the limits of modern computers.
The <a href="https://en.wikipedia.org/wiki/Travelling_salesman_problem">Travelling Salesman Problem (TSP)</a> and the <a href="https://en.wikipedia.org/wiki/Minimum_spanning_tree">Minimum Spanning Tree Problem (MST)</a> are two of the most popular examples for such problems defined using graphs.</p>
<p><img src="tsp-gif.gif" alt="TSP GIF">
<em>TSP asks the following question: Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city? Formally, given a graph, one needs to search the space of permutations to find an optimal sequence of nodes, called a tour, with minimal total edge weights (tour length).</em></p>
<hr>
<h2 id="neural-combinatorial-optimization">Neural Combinatorial Optimization</h2>
<p>Solvers and heuristic algorithms developed in the OR community are able to solve classical problems such as TSP with up to millions of variables.
However, designing powerful and robust optimization algorithms requires significant <strong>specialized knowledge</strong> and years of <strong>trial-and-error</strong>, especially for understudied but high-impact problems arising in <a href="https://arxiv.org/abs/2003.11755">scientific discovery</a> or <a href="https://arxiv.org/abs/1911.05289">computer architecture</a>.
The state-of-the-art TSP solver, <a href="http://www.math.uwaterloo.ca/tsp/concorde.html">Concorde</a>, leverages <a href="https://www.youtube.com/watch?v=q8nQTNvCrjE">over 50 years of research</a> on linear programming, cutting plane algorithms and branch-and-bound.</p>
<div class="alert alert-note">
<div>
At our lab, we&rsquo;re working on <strong>automating</strong> and <strong>augmenting</strong> such expert intuition through Machine Learning [<a href="https://arxiv.org/abs/1811.06128">Bengio <em>et al.</em>, 2018</a>].
</div>
</div>
<p>Since most problems are highly structured, heuristics take the form of rules or policies to make sequential decisions, <em>e.g.</em>, determine the TSP tour one city at a time.
Our research uses deep neural networks to parameterize these policies and train them directly from problem instances.
In particular, <strong>Graph Neural Networks</strong> are the perfect fit for the task because they naturally operate on the graph structure of these problems.</p>
<p><img src="pipeline.png" alt="End-to-end pipeline">
<em>A generic five-stage pipeline for end-to-end learning of combinatorial problems on graphs</em></p>
<hr>
<h2 id="why-study-tsp-in-particular">Why study TSP in particular?</h2>
<p>(1) The problem has an amazing history of serving as an <strong>engine of discovery</strong> for applied mathematics, with several <a href="https://en.wikipedia.org/wiki/John_von_Neumann">legendary</a> <a href="https://en.wikipedia.org/wiki/Richard_E._Bellman">computer</a> <a href="https://en.wikipedia.org/wiki/George_Dantzig">scientists</a> and <a href="https://en.wikipedia.org/wiki/Edsger_W._Dijkstra">mathematicians</a> having a crack at it. Here&rsquo;s an <a href="https://www.youtube.com/watch?v=q8nQTNvCrjE">amazing talk</a> by William Cook, the co-inventor of the current state-of-the-art Concorde TSP solver.</p>
<p>(2) TSP has been the focus of intense research in the combinatorial optimization community. If you come up with a new solver, <em>e.g.</em>, a learning-driven solver, you <em>need</em> to benchmark it on TSP. TSP’s <strong>multi-scale nature</strong> makes it a challenging graph task which requires reasoning about both local node neighborhoods as well as global graph structure.</p>
<p>(3) Learning-based approaches for heuristic algorithms have the potential to be a breakthrough for OR if they are able to learn efficiently on small scale problems and then generalize robustly to larger instances.
However, such <em>scale-invariant</em> generalization is an exciting and unsolved challenge, not just for TSP, but for machine learning as a whole.
<strong>Update:</strong> We explore this in our <a href="https://arxiv.org/abs/2006.07054">latest paper</a>!</p>
<p><img src="https://imgs.xkcd.com/comics/travelling_salesman_problem.png" alt="XKCD:TSP"></p>
<hr>
<p>At the same time, the more <em>profound</em> motivation of using deep learning for combinatorial optimization is not to outperform classical approaches on well-studied problems.
Neural networks can be used as a general tool for tackling previously <em>un-encountered</em> NP-hard problems, especially those that are <strong>non-trivial to design heuristics for</strong> [<a href="https://arxiv.org/abs/1611.09940">Bello <em>et al.</em>, 2016</a>].
We are excited about recent applications of neural combinatorial optimization for <a href="https://deepmind.com/blog/article/AlphaFold-Using-AI-for-scientific-discovery">accelarating drug discovery</a>, <a href="https://arxiv.org/abs/1910.01578">optimizing operating systems</a> and <a href="https://arxiv.org/abs/2004.10746">designing computer chips</a>.</p>
<hr>
<p><strong>P.S.</strong> XB is organizing an exciting workshop at IPAM titled <a href="http://www.ipam.ucla.edu/programs/workshops/deep-learning-and-combinatorial-optimization/">&ldquo;Deep Learning and Combinatorial Optimization&rdquo;</a>.</p>
</description>
</item>
<item>
<title>Quantum Chemistry</title>
<link>https://graphdeeplearning.github.io/project/chemistry/</link>
<pubDate>Tue, 17 Sep 2019 22:20:35 +0800</pubDate>
<guid>https://graphdeeplearning.github.io/project/chemistry/</guid>
<description></description>
</item>
<item>
<title>Spatial Graph ConvNets</title>
<link>https://graphdeeplearning.github.io/project/spatial-convnets/</link>
<pubDate>Tue, 17 Sep 2019 22:20:35 +0800</pubDate>
<guid>https://graphdeeplearning.github.io/project/spatial-convnets/</guid>
<description><h2 id="non-euclidean-and-graph-structured-data">Non-Euclidean and Graph-structured Data</h2>
<p>Classic deep learning architectures such as <a href="http://yann.lecun.com/exdb/publis/pdf/lecun-01a.pdf">Convolutional Neural Networks (CNNs)</a> and <a href="https://www.bioinf.jku.at/publications/older/2604.pdf">Recurrent Neural Networks (RNNs)</a> require the input data domain to be regular, such as 2D or 3D Euclidean grids for Computer Vision and 1D lines for Natural Language Processing.</p>
<p>However, real-world data beyond images and language tends to an underlying structure that is <strong>non-Euclidean</strong>.
Such complex data commonly occurs in science and engineering, and can be modelled intuitively by <strong>heterogeneous graphs</strong>.
Prominent examples include graphs of molecules, 3D meshes in computer graphics, social networks and biological networks.</p>
<p><img src="graph-data.png" alt="Graph structured data"></p>
<hr>
<h2 id="graph-neural-networks">Graph Neural Networks</h2>
<p>Obtaining insights from large and complex graph-structured datasets leads to an interesting challenge for machine learning architectures:
The popular CNN and RNN models need to be redesigned for handling non-Euclidean data, as they cannot leverage familiar regularities such as coordinate systems, vector space structure, or shift invariance.</p>
<p><strong>Graph/Geometric Deep Learning</strong> is an umbrella term for emerging techniques attempting to generalize deep neural networks to non-Euclidean domains such as graphs and manifolds [<a href="https://arxiv.org/abs/1611.08097">Bronstein <em>et al.</em>, 2017</a>].</p>
<div class="alert alert-note">
<div>
We are interested to designing neural networks for arbitrary graphs in order to solve <em>generic</em> graph problems, such as vertex classification, graph classification and graph generation.
</div>
</div>
<p>These Graph Neural Network (GNN) architectures are used as backbones for challenging domain-specific applications in a myriad of domains, including <a href="https://arxiv.org/abs/1704.01212">chemistry</a>, <a href="https://arxiv.org/abs/1902.06673">social networks</a>, <a href="https://arxiv.org/abs/1806.01973">recommendations</a> and <a href="https://arxiv.org/abs/1611.08402">computer graphics</a>.</p>
<hr>
<h2 id="basic-formalism">Basic Formalism</h2>
<p>Each GNN layer computes $d$-dimensional representations for the nodes/edges of the graph through recursive neighborhood diffusion (<em>a.k.a.</em> message passing), where each graph node gathers features from its neighbors to represent local graph structure.
Stacking $L$ GNN layers allows the network to build node representations from the <strong>$L$-hop neighborhood</strong> of each node.</p>
<p><img src="gnn-layer.png" alt="GNN Layer"></p>
<p>Let $h_i^{\ell}$ denote the feature vector at layer $\ell$ associated with node $i$.
The updated features $h_i^{\ell+1}$ at the next layer $\ell+1$ are obtained by applying non-linear transformations to the central feature vector $h_i^{\ell}$ and the feature vectors $h_{j}^{\ell}$ for all nodes $j$ in the neighborhood of node $i$ (defined by the graph structure).
This guarantees the transformation to build local reception fields, such as in standard ConvNets for computer vision, and be invariant to both graph size and vertex re-indexing.</p>
<p>Thus, the most generic version of a feature vector $h_i^{\ell+1}$ at vertex $i$ at the next layer in the GNN is:
\begin{equation}
h_{i}^{\ell+1} = f \left( \ h_i^{\ell} \ , \ { h_{j}^{\ell}: j \rightarrow i } \ \right) ,
\end{equation}
where ${ j \rightarrow i }$ denotes the set of neighboring nodes $j$ pointed to node $i$, which can be replaced by ${ j \in \mathcal{N}_i }$, the set of neighbors of node $i$, if the graph is undirected.</p>
<hr>
<h2 id="classes-of-gnn-architectures">Classes of GNN Architectures</h2>
<p>In other words, a GNN is defined by a mapping $f$ taking as input a vector $h_i^{\ell}$&ndash;the feature vector of the center vertex&ndash;as well as an un-ordered set of vectors {${ h_{j}^{\ell}}$}&ndash;the feature vectors of all neighboring vertices.
The arbitrary choice of the mapping $f$ defines an instantiation of a class of GNNs, <i>e.g.</i>, <a href="https://arxiv.org/abs/1609.02907">GCN</a>, <a href="https://arxiv.org/abs/1706.02216">GraphSage</a>, <a href="https://arxiv.org/abs/1810.00826">GIN</a>.</p>
<p>As an illustration, here&rsquo;s a simple-yet-effective Graph ConvNet from <a href="https://arxiv.org/abs/1605.07736">Sukhbaatar <em>et al.</em>, 2016</a>:
\begin{equation}
h_{i}^{\ell+1} = \text{ReLU} \Big( U^{\ell} h_{i}^{\ell} + \sum_{j \in \mathcal{N}_i} V^{\ell} h_{j}^{\ell} \Big),
\end{equation}
where $U^{\ell}, V^{\ell} \in \mathbb{R}^{d \times d}$ are the learnable parameters.</p>
<p>In a <a href="https://graphdeeplearning.github.io/publication/dwivedi-2020-benchmark/">recent paper</a> on benchmarking GNN architectures, we introduced <strong>block diagrams</strong> to intuitively describe feature update equations such as the one above:</p>
<figure>
<a data-fancybox="" href="gcn-block.png" >
<img data-src="gcn-block.png" class="lazyload" alt="" width="45%" ></a>
</figure>
<hr>
<h2 id="anisotropic-gnns">Anisotropic GNNs</h2>
<p>As graphs have no specific orientations (like up, down, left, right directions in images), message-passing layers such as Sukhbaatar&rsquo;s Graph ConvNet are <strong>isotropic</strong>, treating all neighbors as equally important.
However, this may not be true in general, <em>e.g.</em>, in social network graphs, neighbors in the same community share different relationships and information compared to neighbors from separate communities.</p>
<p>Isotropic GNNs can be upgraded to make the diffusion process <strong>anisotropic</strong> through mechanisms which learn to weigh neighbors based on their relative importance.
For example, <a href="https://arxiv.org/abs/1703.04826">Marchegiani and Titov, 2017</a> upgrade Graph ConvNets by introducing <strong>edge gating</strong> for learning information flow on the graph structure for the task at hand:
\begin{equation}