Algorithm
Graph Convolutional Network (GCN)
activeNeeds verification
Neural network layer that updates each node from a degree-normalised average of its neighbours' features, trained end-to-end for semi-supervised node classification.
Definition
Intuition
Each layer smooths features over one hop of neighbours, then applies a learned linear map and nonlinearity; k layers see k hops.
Complexity
| Time | O(E · d) per layer (sparse) |
|---|---|
| Space | O(V · d + E) |
Python
import torch.nn.functional as F
from torch_geometric.nn import GCNConv
class GCN(torch.nn.Module):
def __init__(self, i, h, o):
super().__init__(); self.c1 = GCNConv(i, h); self.c2 = GCNConv(h, o)
def forward(self, x, ei):
return self.c2(F.relu(self.c1(x, ei)), ei)An interactive step-by-step visualizer for this algorithm is planned for phase 3.
Profile
| Time complexity | O(E · d) per layer (sparse) |
|---|---|
| Space complexity | O(V · d + E) |
Relationships
- Belongs to
- Prerequisite of
- Applied to
- Part of
- Prerequisites
- Graph Laplacian(Concept)
- Message passing(Concept)
- Implemented by
- Deep Graph Library (DGL)(Library / framework)
- PyTorch Geometric (PyG)(Library / framework)
- Related
- GCN and GraphSAGE(Timeline event)