CheriseZhu / GIL

The implementation of our NeurIPS 2020 paper "Graph Geometry Interaction Learning" (GIL)
44 stars 6 forks source link

Graph Geometry Interaction Learning (GIL) in PyTorch

1. Overview

This repository is an implementation of our NeurIPS 2020 paper Graph Geometry Interaction Learning (GIL) in PyTorch, based on HGCN implementation, including following baselines.

Schematic of GIL architecture. image

Shallow methods (Shallow)

Neural Network (NN) methods

Graph Neural Network (GNN) methods

Hyperbolic Graph Neural Network (HGNN) methods

All models can be trained for

2. Setup

2.1 Requirements

python == 3.6.2
torch == 1.1.0
numpy == 1.16.4
scipy == 1.3.0
networkx == 2.3
sage == 9.0
geoopt ==0.0.1
torch_scatter == 1.3.0
torch_geometric == 1.3.0

2.2 Folders

The data/ folder contains five datasets: cora/citeseer/pubmed/disease/airport.
The layers/ folder contains basic operations of euclidean layers and hyperbolic hyp_layers.
The manifolds/ folder contains basic operations of euclidean space and hyperbolic space.
The models/ folder contains the implementation of baselines, which consist of encoder and decoder.
The utils/ folder contains the basic utils for data/eval/train, besides, hyperbolicity is used for calculating the distribution of hyperbolicity.

3. Usage

3.1 set_env.sh

Before training, run

source set_env.sh

This will create environment variables that are used in the code.

3.2 train.py

We provide examples of training commands used to train GIL and other baselines for link prediction and node classification, under the same random seed 1234 for reproducibility purposes.

Link prediction for GIL

python train.py --task lp --dataset disease_lp --model GIL --dropout 0 --weight-decay 0 --manifold PoincareBall --normalize-feats 0 --lr 0.01 --dim 16 --num-layers 2 --act relu --bias 1

python train.py --task lp --dataset airport --model GIL --dropout 0 --weight-decay 0.001 --manifold PoincareBall --normalize-feats 0 --lr 0.01 --dim 16 --num-layers 2 --act relu --bias 1

python train.py --task lp --dataset citeseer --model GIL --dropout 0 --weight-decay 0.0005 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 1 --act relu --bias 1 --normalize-feats 0

python train.py --task lp --dataset cora --model GIL --dropout 0.1 --weight-decay 0.005 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 1 --act relu --bias 1 --normalize-feats 0

python train.py --task lp --dataset pubmed --model GIL --dropout 0.1 --weight-decay 0.0001 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 1 --act relu --bias 1

Link prediction for other baselines

python train.py --task lp --dataset disease_lp --model HGCN --dropout 0 --weight-decay 0 --manifold PoincareBall --normalize-feats 0 --lr 0.01 --dim 16 --num-layers 2 --act relu --bias 1

python train.py --task lp --dataset disease_lp --model HGAT --dropout 0 --weight-decay 0.0001 --manifold PoincareBall --normalize-feats 0 --lr 0.01 --dim 16 --num-layers 2 --act relu --bias 1

python train.py --task lp --dataset airport --model HGCN --dropout 0 --weight-decay 0 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 2 --act relu --bias 1

python train.py --task lp --dataset airport --model HGNN --dropout 0 --weight-decay 0 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 2 --act relu --bias 1

python train.py --task lp --dataset airport --model HGNN --dropout 0 --weight-decay 0 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 2 --act relu --bias 1

python train.py --task lp --dataset cora --model HGCN --dropout 0.1 --weight-decay 0.001 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 1 --act relu --bias 1 --normalize-feats 0

python train.py --task lp --dataset citeseer --model HGCN --dropout 0.5 --weight-decay 0.0001 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 1 --act relu --bias 1

python train.py --task lp --dataset citeseer --model HGNN --dropout 0.1 --weight-decay 0.0001 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 1 --act relu --bias 1

Node classification for GIL

python train.py --task nc --dataset disease_nc --model GIL --dropout 0.1 --weight-decay 0.001 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 2 --act relu --bias 1

python train.py --task nc --dataset airport --model GIL --dropout 0 --weight-decay 0.001 --manifold PoincareBall --normalize-feats 0 --lr 0.01 --dim 16 --num-layers 3 --act relu --bias 1

python train.py --task nc --dataset cora --model GIL --dropout 0.6 --weight-decay 0.001 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 2 --act elu --bias 1 --drop_h 0.9

python train.py --task nc --dataset pubmed --model GIL --dropout 0.6 --weight-decay 0.0005 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 2 --act elu --bias 1 --drop_h 0.9

python train.py --task nc --dataset citeseer --model GIL --dropout 0.5 --weight-decay 0.001 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 2 --act elu --bias 1 --drop_h 0.8

Node classification for other baselines

python train.py --task nc --dataset disease_nc --model HGCN --dropout 0.2 --weight-decay 0.0005 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 3 --act relu --bias 1

python train.py --task nc --dataset airport --model HGCN --dropout 0 --weight-decay 0 --manifold PoincareBall --normalize-feats 0 --lr 0.01 --dim 16 --num-layers 3 --act relu --bias 1

python train.py --task nc --dataset cora --model HGCN --dropout 0.6 --weight-decay 0.0005 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 2 --act relu --bias 1

python train.py --task nc --dataset pubmed --model HGCN --dropout 0.5 --weight-decay 0.0005 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 3 --act relu --bias 1

python train.py --task nc --dataset pubmed --model HGNN --dropout 0.6 --weight-decay 0.0005 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 3 --act relu --bias 1

python train.py --task nc --dataset citeseer --model HGAT --dropout 0.6 --weight-decay 0.001 --manifold PoincareBall --lr 0.01 --dim 16 --num-layers 3 --act elu --bias 1

Citation

If you find this code useful, please cite the following paper:

@inproceedings{zhu2020GIL,
  author={Shichao Zhu and Shirui Pan and Chuan Zhou and Jia Wu and Yanan Cao and Bin Wang},
  title={Graph Geometry Interaction Learning},
  booktitle={Advances in Neural Information Processing Systems},
  year={2020}
}

Some of the code was forked from the following repositories