WWWzq-01 / graphsage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inductive Representation Learning on Large Graphs (GraphSAGE)

For advanced usages, including training with multi-gpu/multi-node, and PyTorch Lightning, etc., more examples can be found in advanced and dist directory.

Requirements

pip install requests torchmetrics==0.11.4 ogb

How to run

Full graph training

Run with following (available dataset: "cora", "citeseer", "pubmed")

python3 train_full.py --dataset cora --gpu 0    # full graph

Results:

* cora: ~0.8330
* citeseer: ~0.7110
* pubmed: ~0.7830

Minibatch training for node classification

Train w/ mini-batch sampling in mixed mode (CPU+GPU) for node classification on "ogbn-products"

python3 node_classification.py

Results:

Test Accuracy: 0.7632

PyTorch Lightning for node classification

Train w/ mini-batch sampling for node classification with PyTorch Lightning on OGB-products. It requires PyTorch Lightning 2.0.1. It works with both single GPU and multiple GPUs:

python3 lightning/node_classification.py

Minibatch training for link prediction

Train w/ mini-batch sampling for link prediction on OGB-citation2:

python3 link_pred.py

Results (10 epochs):

Test MRR: 0.7386

About


Languages

Language:Python 100.0%