Skip to content

Latest commit

 

History

History
78 lines (51 loc) · 3.35 KB

README.md

File metadata and controls

78 lines (51 loc) · 3.35 KB

GNES

Code for ICDM2021 paper GNES: Learning to Explain Graph Neural Networks

Desciption

This codebase proivdes the necessary running environment (including the human explanation label) to train and evaluate the proposed GNES model on the BBBP molecular datasets.

Installation

Python pakage requirement:

  • python==3.7.9
  • keras==2.2.4
  • deepchem==2.3.0
  • chainer_chemistry

Data preparation

  1. Download the BBBP dataset and place it in 'data/':
  1. Download our human explanation labels for BBBP dataset and place them in 'human_mask/':

Run

Run the following scripts to replicate the results:

  1. Train and evaluate GNES
python 1_gcn_train_eval.py

You will get the model performance from the output, and the final model will be saved to 'saved_models/'

  1. Explain and visualize:
python 2_explain_save_masks.py

You will find the following results once done:

  • Explanation data (in json format): will be saved to 'results/masks/'

  • Explanation visualization (figures): will be saved to 'figs/'

Below are some sample explanations from GNES (the importance is marked by the darkness of blue circles on nodes and blue lines on edges. Darker color means more importance is given.):

Orignial GNES explanation
drawing drawing
drawing drawing
drawing drawing

More tips to train GNES on your own datasets:

Please refer to the 'config.py' file first, as it stores major settings of the GNES framework, including:

  • Backbone GCN model settings
  • Whether to enable human explanation label supervision
  • Whether to use the proposed explanation regularazation(s): inlcuding ['sparsity', 'consistency']

If any further questions, please reach out to me via email [email protected]

And if you find this repo useful in your research, please consider cite our paper:

@InProceedings{gao2021gnes,
title={GNES: Learning to Explain Graph Neural Networks},
author={Gao, Yuyang and Sun, Tong and Bhatt, Rishab and Yu, Dazhou and Hong, Sungsoo and Zhao, Liang},
booktitle = {2021 IEEE International Conference on Data Mining (ICDM)},
month = {December},
year = {2021},
organization={IEEE}
}