gnn-model-explainer
gnn-model-explainer copied to clipboard
Using GNNExplainer on my own data
This was previously asked but has not been addressed. Is it possible currently to run the GNNExplainer on our own data and models? If so, is it possible to get an example of how to tweak the file to allow this?
For custom models, the important step is that it needs to be re-trained. In this repo, after finished training, the resulting model is saved to checkpoint, and the explainer_main have to load the model and the ckpt. With custom model, you will need to change the loading of model into your model. So rather than "import models" in explainer_main, you do "import my_own_models".
Also see an example in pygeometric (Thanks to Matthias for helping with the incorporation): Model: https://github.com/rusty1s/pytorch_geometric/blob/master/torch_geometric/nn/models/gnn_explainer.py Usage: https://github.com/rusty1s/pytorch_geometric/blob/master/examples/gnn_explainer.py
Hi @RexYing ,
If I use TensorFlow to train a link prediction model, will GNN explainer also deal with well?
Thank you!
Hi, in this case, you can add a learnable mask in your Tensorflow graph convolution layer, and freeze the other learnable parameter of your network as described in the paper. After optimizing with the explanation objective, you can use the optimized mask to produce explanations. This repository is only for pytorch model, but similar implementation can be easily adapted to Tensorflow.
Hi @RexYing ,
If I use TensorFlow to train a link prediction model, will GNN explainer also deal with well?
Thank you!
hi,how to explain a link prediction model?