Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides building graph neural networks with PyTorch Geometric, covering GCN, GAT, GraphSAGE, GIN and heterogeneous convolutions.
86% 95%+9 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 19 of 22 without it.
3 of 3 safety checks passed
Not used yet
-|----------|----------|
| GCNConv | Homogeneous, semi-supervised node classification | Spectral-inspired, degree-normalized aggregation |
| GATConv / GATv2Conv | When neighbor importance varies | Attention-weighted messages |
| SAGEConv | Large graphs, inductive settings | Sampling-friendly, learnable aggregation |
| GINConv | Graph classification, maximizing expressiveness | As powerful as WL test |
| TransformerConv | Rich edge features, complex interactions | Multi-head attention with edge features |
| EdgeConv | Point clouds, dynamic graphs | MLP on edge features (x_i, x_j - x_i) |
| RGCNConv | Heterogeneous with many relation types | Relation-specific weight matrices |
| HGTConv | Heterogeneous graphs | Type-specific attention |
All conv layers accept (x, edge_index) at minimum. Many also accept edge_attr for edge features.
Use -1 for input channels to let PyG infer dimensions automatically — especially useful for heterogeneous models:
conv = SAGEConv((-1, -1), 64) # Input dims inferred on first forward pass
# Initialize lazy modules:
with torch.no_grad():
out = model(data.x, data.edge_index)
For common architectures, PyG provides ready-made model classes:
from torch_geometric.nn import GraphSAGE, GCN, GAT, GIN
model = GraphSAGE(
in_channels=dataset.num_features,
hidden_channels=64,
out_channels=dataset.num_classes,
num_layers=2,
)
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.