OpenHGNN

This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL [Deep Graph Library] and PyTorch. We integrate SOTA models of heterogeneous graph.

Key Features

  • Easy-to-Use: OpenHGNN provides easy-to-use interfaces for running experiments with the given models and dataset. Besides, we also integrate optuna to get hyperparameter optimization.
  • Extensibility: User can define customized task/model/dataset to apply new models to new scenarios.
  • Efficiency: The backend dgl provides efficient APIs.

Get Started

Requirements and Installation

  • Python >= 3.6

  • PyTorch >= 1.7.1

  • DGL >= 0.7.0

  • CPU or NVIDIA GPU, Linux, Python3

1. Python environment (Optional): We recommend using Conda package manager

conda create -n openhgnn python=3.7
source activate openhgnn

2. Pytorch: Install PyTorch. For example:

# CUDA versions: cpu, cu92, cu101, cu102, cu101, cu111
pip install torch==1.8.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html

3. DGL: Install DGL, follow their instructions. For example:

# CUDA versions: cpu, cu101, cu102, cu110, cu111
pip install --pre dgl-cu101 -f https://data.dgl.ai/wheels-test/repo.html

4. OpenHGNN and other dependencies:

git clone https://github.com/BUPT-GAMMA/OpenHGNN
cd OpenHGNN
pip install -r requirements.txt

Running an existing baseline model on an existing benchmark dataset

python main.py -m model_name -d dataset_name -t task_name -g 0 --use_best_config

usage: main.py [-h] [–model MODEL] [–task TASK] [–dataset DATASET] [–gpu GPU] [–use_best_config]

optional arguments: -h, –help show this help message and exit

​ –model MODEL, -m MODEL name of models

​ –task TASK, -t TASK name of task

​ –dataset DATASET, -d DATASET name of datasets

​ –gpu GPU, -g GPU controls which gpu you will use. If you do not have gpu, set -g -1.

​ –use_best_config use_best_config means you can use the best config in the dataset with the model. If you want to set the different hyper-parameter, modify the openhgnn.config.ini manually. The best_config will override the parameter in config.ini.

​ –use_hpo Besides use_best_config, we give a hyper-parameter example to search the best hyper-parameter automatically.

e.g.:

python main.py -m GTN -d imdb4GTN -t node_classification -g 0 --use_best_config

It is under development, and we release it in a nightly build version. For now, we just give some new models, such as HetGNN, NSHE, GTN, MAGNN, RSHN.

Note: If you are interested in some model, you can refer to the below models list.

Refer to the docs to get more basic and depth usage.

Models

Supported Models with specific task

The link will give some basic usage.

Model Node classification Link prediction Recommendation
RGCN[ESWC 2018] ✔️ ✔️
HAN[WWW 2019] ✔️
KGCN[WWW 2019] ✔️
HetGNN[KDD 2019] ✔️ ✔️
GTN[NeurIPS 2019] ✔️
RSHN[ICDM 2019] ✔️
DGMI[AAAI 2020] ✔️
MAGNN[WWW 2020] ✔️
CompGCN[ICLR 2020] ✔️ ✔️
NSHE[IJCAI 2020] ✔️
NARS[arxiv] ✔️
MHNF[arxiv] ✔️
HGSL[AAAI 2021] ✔️
HGNN-AC[WWW 2021] ✔️
HPN[TKDE 2021] ✔️
RHGNN[arxiv] ✔️

To be supported models

  • Metapath2vec[KDD 2017]

Candidate models

Contributors

GAMMA LAB [BUPT]: Tianyu Zhao, Yaoqi Liu, Fengqi Liang, Yibo Li, Yanhu Mo, Donglin Xia, Xinlong Zhai, Siyuan Zhang, Qi Zhang, , Cheng Yang, Xiao Wang

BUPT: Jiahang Li, Anke Hu

DGL Team: Quan Gan, Jian Zhang

GitHub

GitHub - BUPT-GAMMA/OpenHGNN: This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL.
This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL. - GitHub - BUPT-GAMMA/OpenHGNN: This is an open-source toolkit for Heterogeneous Graph Neural Network(O...