-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
GNNExplainer
migration
#5967
GNNExplainer
migration
#5967
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5967 +/- ##
==========================================
- Coverage 86.44% 84.26% -2.18%
==========================================
Files 361 362 +1
Lines 20298 20404 +106
==========================================
- Hits 17547 17194 -353
- Misses 2751 3210 +459
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Not so sure how to deal with multi-outputs for classification (node/graph). Does it even make sens ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this. Left some initial comments. Will take a look again tomorrow.
Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GNNExplainer
part looks good. Will review the test and examples next.
- add test for `shared_mask=False` - rename function only used internally
- add new MaskType - add better information for user in `supports` - typos - change `index` to `node_index`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small testing bugs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly stylistic requests for tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks again for building this.
Lets address batch
support in another PR because i don't think its too trivial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Overall, this looks great. I made some small adjustments (e.g., check_explanation
was never called), and there was a bug with masks not being put on the correct device. Fixed now :)
- Implements the `GNNExplainer` in the new `explain` module. - Add the argument `node_index` and `target_index` to the `explain.Explainer` class to allow for explanations of model with multi-outputs and specify the node. - Update the examples of the `GNNExplainer` (pyg-team#5924) Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: rusty1s <matthias.fey@tu-dortmund.de> Co-authored-by: Abhijit Gupta <avgupta456@gmail.com>
Hi, |
|
This PR extends the recent `GNNExplainer` work (#5967) to edge classification and edge regression (including link prediction). Draft until the main `GNNExplainer` PR is merged. Progress towards #5925. **Done** - Adds tests for the `subgraph` function in `base.py`. Uses `subgraph([node_idx_1, node_idx_2])` to get the edge k-hop subgraph. - Implements the edge classification and edge regression tasks. Currently only supports a single index into the edge_index. - Adds tests for the edge predictions, similar to the node/graph task tests. **Todo** - Support multiple indexes into the edge_index and/or passing a separate edge_label_index to explain edges not in the graph (ex. negative link prediction). - Create examples to demonstrate edge level explanations. Are there specific datasets/tasks that would be interesting to look at. I would like some preliminary feedback before attempting the above two tasks. I'm also unsure if these additions should be in this PR or a separate one. Co-authored-by: Charles Dufour <dufourc115@gmail.com> Co-authored-by: Charles Dufour <34485907+dufourc1@users.noreply.github.com> Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: rusty1s <matthias.fey@tu-dortmund.de>
GNNExplainer
in the newexplain
module.node_index
andtarget_index
to theexplain.Explainer
class to allow for explanations of model with multi-outputs and specify the node.GNNExplainer
(Example of Using the New Explainability Framework #5924)