This repository is the official implementation of CoSimGNN: Towards Large-scale Graph Similarity Computation.
To install requirements:
Using pip:
pip install -r requirements_pip.txt
Using conda:
conda create -n your_env_name --file requirements_conda.txt
To train the model in the paper, run this command:
python main.py --dataset <dataset> --num_iters <number_of_training_iterations> --model <model_name> --dos_true 'dist'
<dataset> can be among {BA_60, BA_100, BA_200, ER_100, IMDB-L}.
<model_name> can be among {GCN-Mean, GCN-Max, simgnn, gsim_cnn, GMN, CoSim-CNN, CoSim-Mem, CoSim-ATT, CoSim-SAG, CoSim-TOPK, CoSim-GNN10, CoSim-GNN1}
To evaluate the models, run:
python main.py --dataset <dataset> --num_iters <number_of_training_iterations> --model <model_name> --dos_true 'dist' --load_model <model.pth>
Download pretrained models here:
The results are shown as below:
model | BA-60 | BA-100 | BA-200 | ER-100 | IMDB-L | |||||
MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | |
HUNGARIAN | 186.19 | 332.2 | 205.83 | 343.83 | 259.06 | 379.38 | 236.15 | 451.66 | 2.67 | 16.6 |
VJ | 258.73 | 294.83 | 273.94 | 404.61 | 314.45 | 426.86 | 275.22 | 463.53 | 7.68 | 22.73 |
BEAM | 59.14 | 129.26 | 114.02 | 203.76 | 186.03 | 287.88 | 104.73 | 226.42 | 0.39 | 3.93 |
GCN-MEAN | 5.85 | 53.92 | 12.53 | 90.88 | 23.66 | 127.58 | 16.58 | 92.98 | 22.17 | 55.35 |
GCN-MAX | 13.66 | 91.38 | 12.04 | 85.44 | 22.77 | 107.58 | 79.09 | 211.07 | 47.14 | 123.16 |
SIMGNN | 8.57 | 63.8 | 6.23 | 47.8 | 3.06 | 32.77 | 6.37 | 45.3 | 7.42 | 33.74 |
GSIMCNN | 5.97 | 56.05 | 1.86 | 30.18 | 2.35 | 32.64 | 2.93 | 34.41 | 5.01 | 30.43 |
GMN | 2.82 | 38.38 | 4.14 | 34.17 | 1.16 | 26.6 | 1.59 | 28.68 | 3.82 | 27.28 |
COSIM-CNN | 2.5 | 35.53 | 1.49 | 27.2 | 0.53 | 18.44 | 2.78 | 33.36 | 10.37 | 38.03 |
COSIM-ATT | 2.04 | 33.41 | 0.97 | 22.95 | 0.73 | 16.26 | 1.39 | 27.27 | 1.53 | 16.57 |
COSIM-SAG | 3.26 | 38.85 | 3.3 | 33.14 | 1.91 | 35.48 | 1.55 | 29.84 | 1.62 | 16.08 |
COSIM-TOPK | 3.44 | 40.87 | 1.24 | 25.61 | 0.88 | 20.63 | 2.04 | 34.28 | 1.98 | 20.02 |
COSIM-MEM | 5.45 | 48.07 | 1.11 | 24.59 | 0.32 | 14.82 | 1.74 | 26.78 | 1.57 | 17.02 |
COSIM-GNN10 | 2.04 | 33.04 | 1.01 | 23.53 | 0.40 | 16.43 | 1.38 | 27.43 | 1.68 | 17.57 |
COSIM-GNN1 | 1.84 | 32.36 | 0.95 | 22.06 | 0.36 | 15.42 | 1.17 | 25.73 | 2.00 | 18.62 |
To reproduce the results, just download the trained models and set <model.pth> below to any trained models trained under specific dataset. The code will automatically extract all the trained models and validate them on the validation set to choose the best one on the validation set for testing.
python main.py --dataset <dataset> --num_iters <number_of_training_iterations> --model <model_name> --dos_true 'dist' --load_model <model.pth>
📋Pick a licence and describe how to contribute to your code repository.