This repository contains the official code of the paper Subgraphormer: Unifying Subgraph GNNs and Graph Transformers via Graph Products (ICML 2024)
First create a conda environment
conda env create -f Subgraphormer_environment.yml
and activate it
conda activate Subgraphormer
To run subgraphormer on a specific dataset, set the right parameters in the configuration file and simply run:
python main.py
To run a hyperparameter sweep, follow the following steps:
-
Create the sweep using a yaml file from the folder
yamls:
wandb sweep -p <your project name> <path to the yaml file>
For example:
wandb sweep -p zinc12k_project ./yamls/zinc12k_deterministic.yaml
will run a sweep on the zinc12k dataset with a deterministic model (full bag), in the project
zinc12k_project
.wandb sweep -p test_project ./yamls/zinc12k_stochstic.yaml
will run a sweep over zinc12k using stochastic sampling.
This will produce a sweep id
-
Run the sweep:
wandb agent <sweep id>
Our code is motivated by the code of SWL.
For academic citations, please use the following:
@inproceedings{
bar-shalom2024subgraphormer,
title={Subgraphormer: Unifying Subgraph {GNN}s and Graph Transformers via Graph Products},
author={Guy Bar-Shalom and Beatrice Bevilacqua and Haggai Maron},
booktitle={Forty-first International Conference on Machine Learning},
year={2024},
url={https://openreview.net/forum?id=6djDWVTUEq}
}