gnn-model-explainer icon indicating copy to clipboard operation
gnn-model-explainer copied to clipboard

Using GNNExplainer on my own data

Open mdanb opened this issue 4 years ago • 4 comments

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?

mdanb avatar May 13 '20 02:05 mdanb

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

RexYing avatar Jun 23 '20 19:06 RexYing

Hi @RexYing ,

If I use TensorFlow to train a link prediction model, will GNN explainer also deal with well?

Thank you!

zrypscs avatar Jul 22 '20 10:07 zrypscs

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.

RexYing avatar Jul 23 '20 05:07 RexYing

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?

ReadyTeresa avatar Sep 23 '21 12:09 ReadyTeresa