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

Custom motif generation #6179

Merged
merged 15 commits into from
Dec 12, 2022
Merged

Custom motif generation #6179

merged 15 commits into from
Dec 12, 2022

Conversation

cuent
Copy link
Contributor

@cuent cuent commented Dec 8, 2022

This task is part of GNN Explainability Dataset Generation

Implementation of the base class for motif generation. It depends on the framework and API to generate benchmark datasets.

The base class follows some of the structure from @rfdavid PRs. However, I changed a bit since I believe using Data is a better and cleaner approach to generate structures and create wrappers for other structures in PyG or NetworkX.

Once I have some feedback about the MotifGenerator, I will go ahead and

  • update the GraphGenerator.attach_motif()
  • add tests
  • documentation.

@codecov
Copy link

codecov bot commented Dec 8, 2022

Codecov Report

Merging #6179 (77800e3) into master (37f3857) will not change coverage.
The diff coverage is n/a.

❗ Current head 77800e3 differs from pull request most recent head ea491f5. Consider uploading reports for the commit ea491f5 to get more accurate results

@@           Coverage Diff           @@
##           master    #6179   +/-   ##
=======================================
  Coverage   84.55%   84.55%           
=======================================
  Files         372      372           
  Lines       20848    20848           
=======================================
  Hits        17629    17629           
  Misses       3219     3219           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@BlazStojanovic BlazStojanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for his @cuent, I've left some minor comment.

rusty1s added a commit that referenced this pull request Dec 12, 2022
This PR implements benchmark dataset overall framework and API for
generating benchmark datasets (#5817). Any feedback is appreciated,
especially regarding the proposed architecture.

### Implementing a new graph generator

- Create a class inside generators inheriting from GraphGenerator
- Implement `generate_base_graph` using the provided methods
(`generate_feature` and `attach_motif`)
- See #6072 and #6073 to check how it was implemented
- The current Motif generator used here will be replaced by #6179 

### Example for the final user

```
motif = Motif('house')
generator = BAGraph(num_nodes=300, num_motifs=80, motif=motif)
dataset = ExplainerDataset(generator)
```

TODO:

- [x] Finish graph generator (provide all necessary methods: feature
generator, label generator)
- [x] Add tests
- [x] Add to Change log
- [x] Documentation

Co-authored-by: rusty1s <matthias.fey@tu-dortmund.de>
@rusty1s rusty1s changed the title Motif generation Custom motif generation Dec 12, 2022
Copy link
Member

@rusty1s rusty1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Aligned the code to the new interface :)

@rusty1s rusty1s merged commit 1517727 into pyg-team:master Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants