-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Model] Implemented SubgraphX Explainer for Heterogeneous graph #5530
Conversation
* implement chosen node logic based on node degrees using ntype tensors * convert subgraphs to homogenous before using `nx` to get weakly connected components * convert homogenous graphs back to hetero when creating the MCTSNode inner value
* tests successfully running now
as a result of conflict with `dgl.to_homogeneous` when there are 0 `etypes` or i.e. 0 edges in the graph, choose a random node in place of the largest connected component
…largest connected component
* use subgraph device Co-authored-by: Mufei Li <mufeili1996@gmail.com>
Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:
|
Co-authored-by: Mufei Li <mufeili1996@gmail.com>
Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:
|
tests/python/pytorch/nn/test_nn.py
Outdated
} | ||
) | ||
|
||
def forward(self, graph, feat, eweight=None): |
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.
no need for eweight
and related logic
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.
done 👍
Co-authored-by: Mufei Li <mufeili1996@gmail.com>
Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:
|
Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:
|
Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:
|
Ah ok I see how this could be easier/cleaner. I will keep this in mind going forward. |
I'm fine either way. We can also do a second PR after we merge this. By using a homogeneous graph, it's possible to inherit the class for homogeneous graphs and reuse its functions as much as possible. |
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 the great efforts.
…#5530) Co-authored-by: kxm180046 <kxm180046@utdallas.edu> Co-authored-by: Nick Baker <ndbaker1@outlook.com> Co-authored-by: Mufei Li <mufeili1996@gmail.com>
Description
Implemented SubgraphX Explainer (https://arxiv.org/pdf/2102.05152.pdf) for Heterogeneous Graphs.
Checklist
Please feel free to remove inapplicable items for your PR.
Changes
Added a new class HeteroSubgraphX for Heterogeneous graph explanation.
The output of the model has been manually verified on MUTAG dataset. A visualization script was created to visualize the mutag dataset (external ref: https://gist.github.com/ndbaker1/4eec321173fe1dfaff458b957ebc9a1b). Unfortunately there's no ground truth for the explanation, so we cannot quantify the model's performance. Instead, we manually investigated the results and confirms that it aligns well with human intuition.
Inline documentation is added following the original style, and an example of using the module is included in the documentation.