pytorch_geometric
pytorch_geometric copied to clipboard
`PGExplainer`
Closes #2069. Implementation of PGexplainer as described in #2069.
This implementation is based off a pytorch implementation in openreview, which is based on the authors original implementation. The authors original implementation has some differences from the original paper.
Codecov Report
Merging #2576 (64509d7) into master (7029bad) will increase coverage by
0.10%. The diff coverage is99.16%.
@@ Coverage Diff @@
## master #2576 +/- ##
==========================================
+ Coverage 83.88% 83.98% +0.10%
==========================================
Files 349 350 +1
Lines 19200 19320 +120
==========================================
+ Hits 16105 16226 +121
+ Misses 3095 3094 -1
| Impacted Files | Coverage Δ | |
|---|---|---|
| torch_geometric/nn/models/pg_explainer.py | 99.15% <99.15%> (ø) |
|
| torch_geometric/nn/models/__init__.py | 100.00% <100.00%> (ø) |
|
| torch_geometric/nn/models/explainer.py | 97.24% <0.00%> (+1.37%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
@RBendias is trying to map the existing PGExplainer to inherit from the base Explainer class. @wsad1 Please let me know if that aligns with your thinking as well.
@wsad1 and @rusty1s I set the class to the current state of the GNNExplainer; for regression cases, the PGExplainer should also work now. We could still adjust the example according to the GNNExplainer example (using Cora instead of Mutag or the other way around). Thus the attribution values of GNNExplainer/PGExplainer and to_captum would be comparable.
Hi!
Thanks for the great effort with this PR. Is there any update on getting it verified and merged?
Also, in the GNNExplainer class there is an option to select the feature mask type - i.e feature individual_feature and scalar. This is really useful. Could something similar be used in the PGExplainer class?
@wsad1 @RBendias Anything to add before merging?
@rusty1s, we need to resolve a few things before merging. Will look at it this week and get back here.
Hi!
Thanks for the great effort with this PR. Is there any update on getting it verified and merged?
Also, in the
GNNExplainerclass there is an option to select the feature mask type - i.efeatureindividual_featureandscalar. This is really useful. Could something similar be used in thePGExplainerclass?
@simongraham this is a good idea. However, the PGExplainer paper only talks about a parametric approach to generating subgraphs(edge masks) that explain a prediction. I guess this can be extended to learn feature masks too. Are you familiar with some paper that does this, it'll be good to work off that.
@rusty1s , this is ready to merge. please take a look.
Super, will take a look ASAP.
Closing this in favor of https://github.com/pyg-team/pytorch_geometric/pull/6204