Skip to content
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

Merged
merged 42 commits into from
Apr 21, 2023

Conversation

kunmukh
Copy link
Contributor

@kunmukh kunmukh commented Apr 6, 2023

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.

  • The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • I've leverage the tools to beautify the python and c++ code.
  • All changes have test coverage
  • Code is well-documented
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
  • If the PR is for a new model/paper, I've updated the example index here

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.

kxm180046 and others added 30 commits February 17, 2023 13:14
* 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
* use subgraph device

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
@dgl-bot
Copy link
Collaborator

dgl-bot commented Apr 18, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Apr 18, 2023

Commit ID: be65d82b8fa508169d33cc0dd49241ea3776e837

Build ID: 15

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
@dgl-bot
Copy link
Collaborator

dgl-bot commented Apr 18, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Apr 18, 2023

Commit ID: a92f167455967189278d4f4009cef46ecad19c8a

Build ID: 16

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

}
)

def forward(self, graph, feat, eweight=None):
Copy link
Member

@mufeili mufeili Apr 19, 2023

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

Copy link
Contributor

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>
@dgl-bot
Copy link
Collaborator

dgl-bot commented Apr 19, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Apr 19, 2023

Commit ID: f843f826ebb2e662e58e59ee63ff6e3a64a2fb22

Build ID: 17

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Apr 19, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Apr 19, 2023

Commit ID: f4a0614635973aacb7f2eb7b80b5132b154df6e1

Build ID: 18

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Apr 19, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Apr 19, 2023

Commit ID: 544fd73fbac99d2a16032cdd6be1698ed46d7a6b

Build ID: 19

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@ndbaker1
Copy link
Contributor

A high level comment: it might be easier to use homogeneous graphs as much as possible except for model computation.

Ah ok I see how this could be easier/cleaner. I will keep this in mind going forward.
Do you recommend refactoring the code?

@mufeili
Copy link
Member

mufeili commented Apr 20, 2023

A high level comment: it might be easier to use homogeneous graphs as much as possible except for model computation.

Ah ok I see how this could be easier/cleaner. I will keep this in mind going forward. Do you recommend refactoring the code?

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.

Copy link
Member

@mufeili mufeili left a 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.

@mufeili
Copy link
Member

mufeili commented Apr 20, 2023

@dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Apr 20, 2023

Commit ID: 7d79454e1ddf34f21c0904dc33b2d341e102a627

Build ID: 20

Status: ❌ CI test failed in Stage [Distributed Torch CPU Unit test].

Report path: link

Full logs path: link

@mufeili
Copy link
Member

mufeili commented Apr 20, 2023

@dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Apr 20, 2023

Commit ID: 246fa538ff865974c82b8e6ca68e08174c68a260

Build ID: 21

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

@mufeili mufeili merged commit c0f346e into dmlc:master Apr 21, 2023
@kunmukh kunmukh deleted the hetero-subgraphx branch May 10, 2023 17:00
@mufeili mufeili added this to the 2023 GNN utilities milestone May 17, 2023
@mufeili mufeili added the topic: GNN Utilities Issues related to GNN modules, samplers, datasets, etc. label May 17, 2023
DominikaJedynak pushed a commit to DominikaJedynak/dgl that referenced this pull request Mar 12, 2024
…#5530)

Co-authored-by: kxm180046 <kxm180046@utdallas.edu>
Co-authored-by: Nick Baker <ndbaker1@outlook.com>
Co-authored-by: Mufei Li <mufeili1996@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: GNN Utilities Issues related to GNN modules, samplers, datasets, etc.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants