This folder contains a plethora of examples covering different GNN use-cases. This readme highlights some key examples.
A great and simple example to start with is gcn.py
, showing a user how to train a GCN
model for node-level prediction on small-scale homogeneous data.
For a simple link prediction example, see link_pred.py
.
For an improved link prediction approach using Attract-Repel embeddings that can significantly boost accuracy (up to 23% improvement in AUC), see ar_link_pred.py
. This approach is based on Pseudo-Euclidean Attract-Repel Embeddings for Undirected Graphs.
For examples on Open Graph Benchmark datasets, see the ogbn_*.py
examples:
ogbn_train.py
is an example for training a GNN on the large-scaleogbn-papers100m
dataset, containing approximately ~1.6B edges or the medium scaleogbn-products
dataset, ~62M edges.- Uses SGFormer (a kind of GraphTransformer) by default.
- SGFormer Paper
ogbn_proteins_deepgcn.py
is an example to showcase how to train deep GNNs on theogbn-proteins
dataset.ogbn_train_cugraph.py
shows how to accelerate theogbn_train.py
workflow using CuGraph.ogbn_train_perforatedai.py
shows how to optimize theogbn_train.py
workflow using Perforated AI. Perforated AI provides a PyTorch add-on which increases network accuracy by empowering each artificial neuron with artificial dendrites.
For examples on using torch.compile
, see the examples under examples/compile
.
For examples on scaling PyG up via multi-GPUs, see the examples under examples/multi_gpu
.
For examples on working with heterogeneous data, see the examples under examples/hetero
.
For examples on co-training LLMs with GNNs, see the examples under examples/llm
.