Convolution on a graph
A convolution on an image combines each pixel with its neighbours using weights shared across the image. A graph has no grid: a node may have one neighbour or a hundred, in no particular order. The graph convolutional network (GCN) of Kipf and Welling (2017) keeps the two properties that matter, locality and shared weights. One layer computes
where holds one row per node, is a weight matrix shared by every node, is the adjacency matrix and the diagonal matrix of degrees of . Each node's new vector is a weighted sum of its own and its neighbours' transformed vectors.
Kipf and Welling arrived at this from spectral graph theory. Spectral graph convolutions (Bruna et al., 2014) filter a signal in the eigenbasis of the graph Laplacian; Defferrard et al. (2016) replaced the eigendecomposition by a polynomial of the Laplacian, which only reaches hops; the GCN keeps the first-order term, one hop per layer, with the self-loop trick and symmetric normalization that keep repeated layers numerically stable.
The normalized adjacency
when and are linked or equal, with degrees counting the self-loop. The normalized adjacency panel shows this matrix for paper 2472 and the 18 papers within two citations of it, using their degrees in the whole graph. Paper 2472 has 6 citations, so and its own weight is . Its neighbour 192, cited by nothing else (), gets ; neighbour 456 with 10 citations gets .
Two things follow. A neighbour's say shrinks with its own degree, so well-connected papers, which are neighbours of many others, are damped everywhere. And a row of does not sum to 1 (here 1.27), unlike a plain average : the symmetric form is what keeps 's eigenvalues in and lets layers be stacked without the vectors' scale running away.
One node's sum
Written per node, the layer is : every neighbour sends its vector after the shared weight, scaled by , and the node adds the messages. The One paper's sum panel performs this addition row by row with the recorded messages and checks it against the model's output.
The model has two layers. The first maps each paper's 1,433-dimensional word vector to 16 features; the second maps those 16 to 7 topic scores, so its messages are class scores and its sum is a weighted vote. For paper 2472, a Case based paper whose six neighbours are four Case based papers and two Probabilistic methods papers, the vote gives 36 % Case based, 29 % Reinforcement learning and 24 % Neural networks after the softmax. The messages alone favour Reinforcement learning slightly (1.67 against 1.54); the learned biases (−0.31 for Case based, −0.66 for Reinforcement learning) tip the vote back. Paper 192, the Probabilistic methods neighbour with no other citation, carries the largest weight, 0.267, and its message leans to Neural networks. The toolbar steps through the other papers whose whole neighbourhood is drawn.
Learning from 140 labels
Cora's Planetoid split (Yang et al., 2016) labels only 140 of the 2,708 papers for training, 20 per topic; 500 more pick the stopping point and 1,000 are the test set. The loss is the cross-entropy on the 140, but because every layer mixes neighbours, the gradient reaches the weights through the features of every paper within two citations of a labelled one. Training is full-batch: each of the 200 steps runs the whole graph.
The Embeddings over training panel projects the 16-dimensional hidden layer of all 2,708 papers onto the trained embeddings' two principal directions, which hold 28 % and 24 % of their variance, and keeps that view for every epoch. At epoch 0 the papers sit in a tight blob; as training proceeds the clouds spread and the topics separate, including the unlabelled papers that follow their labelled neighbours. Validation accuracy is 59 % after 10 epochs, 70 % after 20 and 78 % after 50; after the 200th epoch training accuracy is 100 %, validation 80.2 % and test 82.1 %, close to the 81.5 % Kipf and Welling report.
What followed
Wu et al. (2019) showed that most of the GCN's power on citation graphs comes from the propagation, not the nonlinearity: SGC precomputes once and fits a logistic regression on it, with similar accuracy. The fixed weights are the GCN's main restriction; the GAT tab learns a weight for every edge instead, and the Message passing tab shows what happens when GCN layers are stacked deep.
This page's model is written in plain PyTorch (the </> chips) and checked against PyTorch Geometric's gcn_norm and GCNConv and scikit-learn's PCA; the check also retrains the run from its seed and gets every recorded loss and the final weights. Training took 2.9 seconds on one CPU thread.
Papers
- Semi-Supervised Classification with Graph Convolutional Networks The GCN layer, its derivation from spectral convolutions, and the Cora setup this page reproduces.
- Convolutional Neural Networks on Graphs with Fast Localized Spectral Filtering Chebyshev polynomial filters, the K-hop spectral convolution the GCN cuts to one hop.
- Spectral Networks and Locally Connected Networks on Graphs The first convolutions defined in the graph Laplacian's eigenbasis.
- Simplifying Graph Convolutional Networks SGC: the nonlinearities removed, the propagation precomputed, much the same accuracy.
- Revisiting Semi-Supervised Learning with Graph Embeddings Planetoid, the source of the Cora split used here.
- Collective Classification in Network Data The Cora citation graph and its word features.