Captum for link prediction (edge level) #6354
Replies: 3 comments 7 replies
-
Hi! The |
Beta Was this translation helpful? Give feedback.
-
Hi @RBendias and thank you for your prompt reply! I read what IG accepts as input, so my question is: what to do about |
Beta Was this translation helpful? Give feedback.
-
Hi. Could you share the code of the model and also the training loop? That might help me to understand the problem better. My first assumption would be that you can only generate explanations with respect to the input you provide to the model during inference, which would be only the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I am wondering if there is a way to explain link prediction in terms of existing edges (which were used to train a GNN model)? I am trying to find edges in the existing graph, which contribute the most to predicting new edges (new edges are only formed between existing nodes).
I need to get explanations for thousands of edges, so something supporting multiple predictions in batches should be better. I know you're working on batch explanations with Captum #5917, which should speed things up (and I am very looking forward to it!). As far as I can understand, methods like GNNExplainer require training a NN to explain a single sample, which, I think, is going to take way too much time for my problem.
I am trying to get captum work with IG method, but I am somewhat stuck (I am using this example from @RBendias as a reference: #4058 (comment)), but I replaced the attribute argument with edge mask (just like in captum_explainability example https://github.com/pyg-team/pytorch_geometric/blob/master/examples/captum_explainability.py), so the code looks like this:
But I'm getting the following error:
If I replace
edge_mask
and make it shaped liketest_data.num_edges
, the code works.But then I do not quite understand what it outputs (and how it is relevant to the existing graph, which we use to train the
model
). Can you help?Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions