Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using GNNExplainer on my own data #11

Open
mdanb opened this issue May 13, 2020 · 4 comments
Open

Using GNNExplainer on my own data #11

mdanb opened this issue May 13, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@mdanb
Copy link

mdanb commented May 13, 2020

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 mdanb added the bug Something isn't working label May 13, 2020
@RexYing
Copy link
Owner

RexYing commented Jun 23, 2020

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

@zrypscs
Copy link

zrypscs commented Jul 22, 2020

Hi @RexYing ,

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

Thank you!

@RexYing
Copy link
Owner

RexYing commented Jul 23, 2020

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.

@ReadyTeresa
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants