Call visualize_graph
on pytorch_geometric
version 2.2.0
#6286
Unanswered
PeeteKeesel
asked this question in
Q&A
Replies: 1 comment 9 replies
-
You should be able to call it via explanation = explainer(
G.x,
G.edge_index,
cell_batch=torch.tensor([0]),
drug=torch.tensor(drug).double().reshape(1, 256)
) |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey all 👋🏽
I have build a bi-modal regression GNN and now would like to run
GNNExplainer
on it. Let me explain my problem.✅ What works: I was able to successfully initialize the
GNNExplainer
and callexplain_graph
.Now I wanted to call
visualize_graph
on theexplainer
but saw that this method got deleted after version2.0.3
.So, currently it is not possible to visualize a (sub-)graph on an initialized
GNNExplainer
. Not really sure why that is but I believe it has it's reasons.⛔ What does not work: Now I saw in the provided gnn_explainer.py example file that it should in the newest version be called like that:
That works. However when I now want to call
it throws the error that
which is makes sense since my
forward
method looks like this:However, I don't want to change the input parameter names of my
forward
method tox
andedge_index
. The reason is that I will add two differentx
andedge_index
in future iteration such that I have a bi-modal network with two GNNs. So that's why I can't change it tox
andedge_index
since in the future there will be basicallyx2
andedge_index2
. So I would like to keep my namings.🤔 Is there any other way how I can run
explainer
while keeping the naming of the arguments of myforward
method?Beta Was this translation helpful? Give feedback.
All reactions