랭킹으로 돌아가기

snap-stanford/pretrain-gnns

Python

Strategies for Pre-training Graph Neural Networks

graph-neural-networksgraph-representation-learning
스타 성장
스타
1.1k
포크
174
주간 성장
이슈
37
5001k
2020년 2월2022년 3월2024년 5월2026년 7월
아티팩트PyPIpip install pretrain-gnns
README

Strategies for Pre-training Graph Neural Networks

This is a Pytorch implementation of the following paper:

Weihua Hu*, Bowen Liu*, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay Pande, Jure Leskovec. Strategies for Pre-training Graph Neural Networks. ICLR 2020. arXiv OpenReview

If you make use of the code/experiment in your work, please cite our paper (Bibtex below).

@inproceedings{
hu2020pretraining,
title={Strategies for Pre-training Graph Neural Networks},
author={Hu, Weihua and Liu, Bowen and Gomes, Joseph and Zitnik, Marinka and Liang, Percy and Pande, Vijay and Leskovec, Jure},
booktitle={International Conference on Learning Representations},
year={2020},
url={https://openreview.net/forum?id=HJlWWJSFDH},
}

Installation

We used the following Python packages for core development. We tested on Python 3.7.

pytorch                   1.0.1
torch-cluster             1.2.4              
torch-geometric           1.0.3
torch-scatter             1.1.2 
torch-sparse              0.2.4
torch-spline-conv         1.0.6
rdkit                     2019.03.1.0
tqdm                      4.31.1
tensorboardx              1.6

Dataset download

All the necessary data files can be downloaded from the following links.

For the chemistry dataset, download from chem data (2.5GB), unzip it, and put it under chem/. For the biology dataset, download from bio data (2GB), unzip it, and put it under bio/.

Pre-training and fine-tuning

In each directory, we have three kinds of files used to train GNNs.

1. Self-supervised pre-training

python pretrain_contextpred.py --output_model_file OUTPUT_MODEL_PATH
python pretrain_masking.py --output_model_file OUTPUT_MODEL_PATH
python pretrain_edgepred.py --output_model_file OUTPUT_MODEL_PATH
python pretrain_deepgraphinfomax.py --output_model_file OUTPUT_MODEL_PATH

This will save the resulting pre-trained model to OUTPUT_MODEL_PATH.

2. Supervised pre-training

python pretrain_supervised.py --output_model_file OUTPUT_MODEL_PATH --input_model_file INPUT_MODEL_PATH

This will load the pre-trained model in INPUT_MODEL_PATH, further pre-train it using supervised pre-training, and then save the resulting pre-trained model to OUTPUT_MODEL_PATH.

3. Fine-tuning

python finetune.py --model_file INPUT_MODEL_PATH --dataset DOWNSTREAM_DATASET --filename OUTPUT_FILE_PATH

This will finetune pre-trained model specified in INPUT_MODEL_PATH using dataset DOWNSTREAM_DATASET. The result of fine-tuning will be saved to OUTPUT_FILE_PATH.

Saved pre-trained models

We release pre-trained models in model_gin/ and model_architecture/ for both biology (bio/) and chemistry (chem/) applications. Feel free to take the models and use them in your applications!

Reproducing results in the paper

Our results in the paper can be reproduced by running sh finetune_tune.sh SEED DEVICE, where SEED is a random seed ranging from 0 to 9, and DEVICE specifies the GPU ID to run the script. This script will finetune our saved pre-trained models on each downstream dataset.

관련 저장소
pyg-team/pytorch_geometric

Graph Neural Network Library for PyTorch

PythonPyPIMIT Licensepytorchgeometric-deep-learning
pyg.org
23.9k4k
dmlc/dgl

Python package built to ease deep learning on graph, on top of existing DL frameworks.

PythonPyPIApache License 2.0deep-learninggraph-neural-networks
dgl.ai
14.3k3k
kmario23/deep-learning-drizzle

Drench yourself in Deep Learning, Reinforcement Learning, Machine Learning, Computer Vision, and NLP by learning from these exciting lectures!!

HTMLmachine-learningdeep-learning
deep-learning-drizzle.github.io
12.9k3k
yzhao062/anomaly-detection-resources

Anomaly detection related books, papers, videos, and toolboxes. Last update late 2025 for LLM and VLM works!

PythonPyPIGNU Affero General Public License v3.0outlier-detectionanomaly-detection
9.4k1.8k
naganandy/graph-based-deep-learning-literature

links to conference publications in graph-based deep learning

Jupyter NotebookMIT Licensegraph-neural-networksgraph-convolutional-networks
5.1k781
RUCAIBox/RecBole

A unified, comprehensive and efficient recommendation library

PythonPyPIMIT Licenserecommender-systemscollaborative-filtering
recbole.io
4.5k746
ruvnet/RuVector

RuVector is a High Performance, Real-Time, Self-Learning Ai, Vector GNN, Memory DB built in Rust.

Rustcrates.ioMIT Licenseaiai-ocr
cognitum.one/RuVector
4.4k584
magicleap/SuperGluePretrainedNetwork

SuperGlue: Learning Feature Matching with Graph Neural Networks (CVPR 2020, Oral)

PythonPyPIOtherdeep-learningfeature-matching
4.1k760
alibaba/GraphScope

🔨 🍇 💻 🚀 GraphScope: A One-Stop Large-Scale Graph Computing System from Alibaba | 一站式图计算系统

C++Apache License 2.0graphgraph-computation
graphscope.io
3.6k470
stellargraph/stellargraph

StellarGraph - Machine Learning on Graphs

PythonPyPIApache License 2.0graphsmachine-learning
stellargraph.readthedocs.io
3.1k442
benedekrozemberczki/pytorch_geometric_temporal

PyTorch Geometric Temporal: Spatiotemporal Signal Processing with Neural Machine Learning Models (CIKM 2021)

PythonPyPIMIT Licensepytorchgraph-neural-networks
3k405
alibaba/euler

A distributed graph deep learning framework.

C++Apache License 2.0graphgraph-learning
2.9k555