pytorch_geometric icon indicating copy to clipboard operation
pytorch_geometric copied to clipboard

`PGExplainer`

Open wsad1 opened this issue 4 years ago • 9 comments

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.

wsad1 avatar May 15 '21 07:05 wsad1

Codecov Report

Merging #2576 (64509d7) into master (7029bad) will increase coverage by 0.10%. The diff coverage is 99.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

codecov-commenter avatar May 22 '21 06:05 codecov-commenter

@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.

rusty1s avatar Feb 23 '22 08:02 rusty1s

@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.

RBendias avatar Feb 23 '22 09:02 RBendias

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?

simongraham avatar May 19 '22 07:05 simongraham

@wsad1 @RBendias Anything to add before merging?

rusty1s avatar May 19 '22 22:05 rusty1s

@rusty1s, we need to resolve a few things before merging. Will look at it this week and get back here.

wsad1 avatar May 23 '22 13:05 wsad1

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?

@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.

wsad1 avatar May 25 '22 07:05 wsad1

@rusty1s , this is ready to merge. please take a look.

wsad1 avatar Jun 10 '22 07:06 wsad1

Super, will take a look ASAP.

rusty1s avatar Jun 10 '22 08:06 rusty1s

Closing this in favor of https://github.com/pyg-team/pytorch_geometric/pull/6204

rusty1s avatar Dec 20 '22 08:12 rusty1s