- Ubuntu 20.04
- PyTorch 1.10.1
- PyG 2.0.4
- Others: Please refer to environment.yml and requirements.txt
python -m benchmark.kernel.pipeline.py --task explain --model_name GCN_3l --dataset_name bbbp --target_idx 0 --explainer FlowX_plus --sparsity 0.7 --force_recalculate
task
: [train
,test
,explain
] controls the phase of explanations. Please runtrain
before explaining.model_name
: [GCN_3l
,GIN_3l
] controls the GNN model waiting to be explained.dataset_name
controls the dataset used to be explained.target_idx
determines which task to explain when there are multiple tasks. When there is only 1 task, set it to be 0.explainer
determines the explainer used to explain the model we choose.sparsity
is a metric & hyperparameter that we can control to determine what percentage of edges/nodes/flows we want the explainer to return.force_recalculate
is generally used for debugging. When an explainer generate an explanation, this explanation will be saved and reused when needed. However, when this flag is set, explainers will never use saved explanations.
This project is licensed under the terms of the MIT license.
If you find FlowX useful in your research, please consider citing:
@ARTICLE{gui2023flowx,
author={Gui, Shurui and Yuan, Hao and Wang, Jie and Lao, Qicheng and Li, Kang and Ji, Shuiwang},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
title={FlowX: Towards Explainable Graph Neural Networks via Message Flows},
year={2023},
volume={},
number={},
pages={1-12},
keywords={Graph neural networks;Task analysis;Predictive models;Electronic mail;Training;Philosophical considerations;Mutual information;Deep learning;graph neural networks;explainability;message passing neural networks},
doi={10.1109/TPAMI.2023.3347470}}