Open veenapaddy opened 2 years ago
@jermainewang Can I work on this? Please, provide more details.
Hi @avinashsai , it will be great if you can work on that. Once you have a preliminary implementation, you can open a PR for that. We can then have more discussions in that PR and further polish the implementation.
🚀 Feature
Support binary classifier GNNs(output dimension 1, i.e. a single score) in GNNExplainer
Motivation
GNNExplainer in DGL assumes multi-class classification as the objective of the classifier it is explaining. So if we naively feed it a binary classifier it will assume all data points belong to a single class, and fail to explain any single target node correctly. Workarounds are possible for a user who is aware of this, but require the user to change the structure of the GNN model that she/he is trying to explain from output dimension 1, to 2. This is inconvenient for a user who knows what they are doing, but for the user who does not dig into the source code will cause wrong results.
Alternatives
Workarounds by the user are a possible alternate, but less intuitive.
The code segment in question
page: https://docs.dgl.ai/en/latest/_modules/dgl/nn/pytorch/explain/gnnexplainer.html