This is the official implementation of "Empower Post-hoc Graph Explanations with Information Bottleneck: A Pre-training and Fine-tuning Perspective"
You can run the following command to install the required package:
>> conda create -n wjh_pytorch python=3.7
>> conda install pytorch==1.12.1=cuda111py37he43340c_201 cudatoolkit=11.1 -c pytorch -c conda-forge
>> pip install torch-scatter==2.0.9
>> pip install torch-sparse==0.6.15
>> pip install torch-geometric==2.0.2
>> pip install networkxThe datasets MoleculeNet and PPI can be downloaded manually. Please place the datasets in the dataset dictionary.
The trained target GNN models can be found here. The saved GNNs should be placed in the models/ckpts_model.
We provide a python script to run our method:
python demo.py --gpu 0 --dataset bace --task 0 --coff_ib 0.1 --coff_ir 0.1 --trick cat --logfile results.log --need_train