This repository contains all the code for the purpose of the Reproducibility challenge 2021/2022.
Paper that was reproduced is
- Paaßen, B., Grattarola, D., Zambon, D., Alippi, C., and Hammer, B. (2021). Graph Edit Networks. Proceedings of the Ninth International Conference on Learning Representations (ICLR 2021). Link
Copyright (C) 2020-2021
Benjamin Paaßen
The University of Sydney
Daniele Grattarola, Daniele Zambon
Università della Svizzera italiana
Most of the code is forked from https://gitlab.com/bpaassen/graph-edit-networks, SHA = 588dffec.
All software enclosed in this repository is written in Python 3. To train graph edit networks, you additionally require PyTorch (Version >= 1.4.0; torchvision or cuda are not required). To train tree edit networks, you additionally require edist (Version >= 1.1.0), which in turn requires numpy (Version >= 1.17).
To run the kernel time series prediction (Paaßen et al., 2018) baseline, you require edist (Version >= 1.1.0) and scikit-learn (Version >= 0.21.3).
These packages are also sufficient to run the experiments. All dependencies are available on pip.
File structure is as follows:
envfolder for the environment setup.- The code for each individual class of data is in it's separated folder. Each folder also contains the test file
for the code in the current directory.
aditional_baselines,boolean_formulae,degree_rules,game_of_life,graph_edit,hep_th,peano_addition,pytorch_graph_edit_networks,pytorch_tree_edit_networks.
train_eval_notebooks, where you can find 4 notebooks for training and evaluationg the models that were used for the paper.visualisationfolder, where is the script that generates the visualisations used in the paper.
Reproducing our experiments is possible by running the four included ipython
notebooks in train_eval_notebooks folder. All notebooks should run without any additional preparation.
Installing the dependencies listed above should suffice. Note that slight
deviations may occur due to different sampling.
In the remainder of this section, we list the different experiments and their
notebooks with the expected results in each case.
graph_dynamical_systems.ipynb contains the experiments on the three graph
dynamical systems (edit cycles, degree rules, and game of life).
This file also contains the experiments that are described in 4.2.1 and 4.2.2.
pytorch_ten.ipynb runs a tree edit network on the two tree dynamical systems
(boolean and peano addition).
This file also contains the experiments that are described in 4.2.3.
hep_th_runtimes.ipynb runs graph edit networks on realistic graphs from the
HEP-Th dataset and reports the runtime needed. Then, we compute a log-log fit
of runtime versus graph size.
This file also contains the experiments that are described in 4.2.4.
In more detail, the following files are contained in this repository (in alphabetical order):
baseline_models.py: An implementation of variational graph autoencoders (VGAE; Kipf and Welling, 2016) for time series prediction.boolean_formulae.py: A Python script generating the Boolean dataset and its teaching protocol.boolean_formulae_test.py: A unit test forboolean_formulae.py.degree_rules.py: A Python script generating the degree rules dataset and its teaching protocol.degree_rules_test.py: A unit test fordegree_rules.py.game_of_life.py: A Python script generating the game of life dataset and its teaching protocol.game_of_life_test.py: A unit test forgame_of_life.py.graph_dynamical_systems.ipynb: An ipython notebook containing the graph edit cycles, degree rules, and game of life experiments.graph_edit_cycles.py: A Python script generating the graph edit cycles dataset and its teaching protocol.graph_edits.py: A Python implementation of graph edits.hep-th: A directory containing the HEP-Th dataset as used in this paper, including the preprocessing script used.hep_th.py: A Python script to load the HEP-Th dataset and its teaching protocol.hep_th_runtimes.csv: A table of runtime results obtained on the HEP-Th dataset.hep_th_runtimes.ipynb: An ipython notebook to generate the runtime results.hep_th_runtimes.png: An image file displaying the runtime results obtained on the HEP-Th dataset.hep_th_test.py: A unit test forhep_th.py.peano_addition.py: A Python script generating the Peano dataset and its teaching protocol.peano_addition_test.py: A unit test forpeano_addition.py.pygraphviz_interface.py: An auxiliary file to draw graphs using graphviz.pytorch_graph_edit_networks.py: An implementation of graph edit networks and the according loss function as reported in the paper.pytorch_graph_edit_networks_test.py: A unit test forpytorch_graph_edit_networks.py.pytorch_ten.ipynb: An ipython notebook containing the Boolean and the Peano experiments.pytorch_tree_edit_networks.py: An implementation of tree edit networks including a general-purpose teaching protocol (with the caveats described above).pytorch_tree_edit_networks_test.py: A unit test forpytorch_tree_edit_networks.py.README.md: this file.visualisation-R_script.R: Visualisation script.