This repository contains the official code of the paper Size-Invariant Graph Representations for Graph Classification Extrapolations (ICML 2021 Long Talk).
- PyTorch 1.7.1
torch-cluster1.5.8torch-geometric1.6.3torch-scatter2.0.5torch-sparse0.6.8torch-spline-conv1.2.0torch-geometric1.6.3ray[tune]1.1.0
Install the additional dependencies as follows:
$ pip install -r requirements.txtPlease, run the following commands to download and set up the data folder.
$ wget https://www.dropbox.com/s/38eg3twe4dd1hbt/data.zip
$ unzip data.zipThe command above will place the data already sampled in the folder data/.
Please specify its absolute path in base_config.yaml.
The provided configurations allow you to run the hyperparameter tuning of NCI1.
To tune for other datasets and/or models:
- In
hyper_config.yamlspecify the hyperparameters values. For details on the range of the hyperparameter refer to the Appendix. - In
base_config.yamlsetdataset_nametoNCI1,NCI109,PROTEINSorbrain-net(i.e. schizophrenia). - In
base_config.yamlset themodeltoKaryGNN(i.e.$\Gamma_\text{GNN}$ ),KaryRPGNN(i.e.$\Gamma_\text{RPGNN}$ ),GraphletCounting(i.e.$\Gamma_\text{1-hot}$ ),GNNorRPGNN. You can specify the GNN ingnn_typeaspna,gcnorginand the XU-READOUT ingraph_poolingasmean,maxorsum.
Run
$ python hypertuning.pyThe provided configurations allow you to run NCI1 with the best hyperparameters.
To run for other datasets and/or models specify the parameters
in base_config.yaml.
Run
$ python lightning_modules.pyIf you use this code, please cite
@inproceedings{bevilacqua2021size,
title={Size-invariant graph representations for graph classification extrapolations},
author={Bevilacqua, Beatrice and Zhou, Yangze and Ribeiro, Bruno},
booktitle={International Conference on Machine Learning},
pages={837--851},
year={2021},
organization={PMLR}
}
