The library includes data and scripts to reproduce the experiments reported in the paper.
Federico Errica, Marco Podda, Davide Bacciu, Alessio Micheli: A Fair Comparison of Graph Neural Networks for Graph Classification. Proceedings of the 8th International Conference on Learning Representations (ICLR 2020).
@inproceedings{errica_fair_2020,
title = {A fair comparison of graph neural networks for graph classification},
booktitle = {Proceedings of the 8th {International} {Conference} on {Learning} {Representations} ({ICLR})},
author = {Errica, Federico and Podda, Marco and Bacciu, Davide and Micheli, Alessio},
year = {2020}
}
--
D&D | NCI1 | PROTEINS | |
---|---|---|---|
Baseline | |||
DGCNN | |||
DiffPool | |||
ECC | |||
GIN | |||
GraphSAGE | |||
CGMM | |||
ECGMM | |||
iCGMMf | |||
GSPN | - | - |
IMDB-B | IMDB-M | REDDIT-B | REDDIT-5K | COLLAB | |
---|---|---|---|---|---|
Baseline | |||||
DGCNN | |||||
DiffPool | |||||
ECC | - | - | - | ||
GIN | |||||
GraphSAGE | |||||
CGMM | |||||
ECGMM | |||||
iCGMMf | |||||
GSPN | - | - |
If you are interested in an introduction to Deep Graph Networks (and a new library!), check this out:
Bacciu Davide, Errica Federico, Micheli Alessio, Podda Marco: A Gentle Introduction to Deep Learning for Graphs, Neural Networks, 2020. DOI: 10.1016/j.neunet.2020.06.006
.
We provide a script to install a virtual environment called gnn-comparison
. You will a Python version installed on your system.
To install the required packages, follow there instructions (tested on a linux terminal):
-
clone the repository
git clone https://github.com/diningphil/gnn-comparison
-
cd
into the cloned directorycd gnn-comparison
-
change the
PYTHON_VERSION
variable ininstall.sh
to your system's Python version.
-
run the installation script
source install_original.sh [<your_cuda_version>]
Where <your_cuda_version> is an optional argument that can be either cpu
, cu92
, cu100
or cu101
.
Pytorch Geometric 1.4.0 will also be installed.
-
run the installation script
source install.sh [<your_cuda_version>] [<your_pytorch_version>]
Where <your_pytorch_version> should be >= 2.0.1
, and <your_cuda_version> is an optional argument that can be either cpu
, cu116
, cu117
or cu118
. If you do not provide any of them the script will default to Pytorch 2.0.1
and cpu
.
Pytorch Geometric 2.3.1 will also be installed.
Notes:
- It is up to you to ensure the Python version is consistent with the Pytorch, Torch Geometric, and CUDA versions you are going to install
- Please open an issue if something is not working as expected.
To reproduce the experiments, first preprocess datasets as follows:
python PrepareDatasets.py DATA/CHEMICAL --dataset-name <name> --outer-k 10
python PrepareDatasets.py DATA/SOCIAL_1 --dataset-name <name> --use-one --outer-k 10
python PrepareDatasets.py DATA/SOCIAL_DEGREE --dataset-name <name> --use-degree --outer-k 10
Where <name>
is the name of the dataset. Then, substitute the split (json) files with the ones provided in the data_splits
folder.
Please note that dataset folders should be organized as follows:
CHEMICAL:
NCI1
DD
ENZYMES
PROTEINS
SOCIAL[_1 | _DEGREE]:
IMDB-BINARY
IMDB-MULTI
REDDIT-BINARY
REDDIT-MULTI-5K
COLLAB
Then, you can launch experiments by typing:
cp -r DATA/[CHEMICAL|SOCIAL_1|SOCIAL_DEGREE]/<name> DATA
python Launch_Experiments.py --config-file <config> --dataset-name <name> --result-folder <your-result-folder> --debug
Where <config>
is your config file (e.g. config_BaselineChemical.yml), and <name>
is the dataset name chosen as before.
You can only use CUDA with the --debug
option, parallel GPUs support is not provided.
If you would like PyTorch not to spawn multiple threads for each process (highly recommended), append export OMP_NUM_THREADS=1
to your .bashrc file.