Beyond Graph Neural Networks with Lifted Relational Neural Networks
This repository contains materials to reproduce the results from Beyond Graph Neural Networks with Lifted Relational Neural Networks.
For the GNN frameworks, please follow the instructions at their respective pages, i.e. PyG and DGL.
For reference, we used PyG 1.4.3 and DGL 0.4.3 (actual versions as of March 2020).
Additionally, you will also need some basic python libraries like Pandas and Matplotlib to analyse the results, but you most likely already have those anyway.
For the LRNN framework, all you need is Java ≥ 1.8.
NeuraLogic.jar
included directly in this repo. For its source see a separate NeuraLogic repository.run a script to download and process all (73) the NCI datasets.
bash create_datasets.sh
DIR
java -jar mol2csv.jar DIR
DIR
into simple csv representation, creating one folder per each datasetpython csvs2graphs.py DIR OUTDIR
run the PyG script with some model (gcn/gsage/gin) on some of the processed datasets, e.g. for the first dataset (NCI 786_0) as:
python run_script_pyg.py -sd DIR/786_0 -model gcn -lr 1.5e-05 -ts 2000 -out OUTDIR/pyg/786_0
very similarly, run the DGL version by:
python run_script_dgl.py -sd DIR/786_0 -model gcn -lr 1.5e-05 -ts 2000 -out OUTDIR/dgl/786_0
run the LRNN framework on the same datasets and models (templates) by calling:
java -Xmx5g -jar NeuraLogic.jar -sd DIR/786_0 -t ./templates/gcn.txt -ts 2000 -fp fold -init glorot -lr 1.5e-05 -ef XEnt -out OUTDIR/lrnn/786_0
Change the parameters of the scripts as you like (models, datasets, batch sizes, training steps, learning rates, …) to further compare the behavior and runtimes of the frameworks, as done in the additional experiments in the paper.
./grid
All the relevant information from the experiments gets stored in the JSON files in the respective OUTDIR
directories. For reference, we include our original results from experiments run with the included batch job scripts.
You can analyze our and your new results by own means in the respective JSON files, but we also include a convenience script to do some loading into DataFrames and plotting of the results (used for the paper), so you might want to bootstrap from there:
./analyse_results.py
You can find the Lifted Relational Neural Networks framework itself being developed at the Neuralogic repository.
Please let me know (souregus@gmail.com) if you find any bugs or anything interesting!