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

Add basic augmentation methods #5548

Merged
merged 40 commits into from
Oct 5, 2022
Merged

Add basic augmentation methods #5548

merged 40 commits into from
Oct 5, 2022

Conversation

EdisonLeeeee
Copy link
Contributor

@EdisonLeeeee EdisonLeeeee commented Sep 27, 2022

This PR added some basic augmentation methods for graphs:

  • NodeShuffle: randomly permute node ids
  • MaskFeature: randomly mask feature columns
  • AddEdge: randomly add edges into graphs

TODO:

  • add doc-string
  • add test

Link to #5452

@codecov
Copy link

codecov bot commented Sep 27, 2022

Codecov Report

Merging #5548 (7312eb1) into master (4a9a494) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 7312eb1 differs from pull request most recent head 50c9c0a. Consider uploading reports for the commit 50c9c0a to get more accurate results

@@            Coverage Diff             @@
##           master    #5548      +/-   ##
==========================================
- Coverage   83.77%   83.75%   -0.02%     
==========================================
  Files         346      347       +1     
  Lines       19070    19125      +55     
==========================================
+ Hits        15975    16019      +44     
- Misses       3095     3106      +11     
Impacted Files Coverage Δ
torch_geometric/utils/augmentation.py 100.00% <100.00%> (ø)
torch_geometric/sampler/utils.py 80.51% <0.00%> (-7.18%) ⬇️
torch_geometric/sampler/neighbor_sampler.py 91.87% <0.00%> (-1.92%) ⬇️
torch_geometric/loader/link_loader.py 92.53% <0.00%> (-1.50%) ⬇️
torch_geometric/nn/aggr/multi.py 100.00% <0.00%> (ø)

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

Copy link
Member

@wsad1 wsad1 left a comment

Choose a reason for hiding this comment

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

Looks good mostly. Left some initial comments.

torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
EdisonLeeeee and others added 5 commits September 29, 2022 21:28
Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>
Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>
Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>
Copy link
Member

@wsad1 wsad1 left a comment

Choose a reason for hiding this comment

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

Thanks a lot.

torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
test/utils/test_augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
EdisonLeeeee and others added 3 commits September 29, 2022 21:59
Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>
Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>
Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>
@EdisonLeeeee
Copy link
Contributor Author

Thank you @wsad1 for your feedback. Really helpful!

torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Show resolved Hide resolved
EdisonLeeeee and others added 2 commits September 30, 2022 09:48
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
EdisonLeeeee and others added 4 commits September 30, 2022 09:50
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
@wsad1
Copy link
Member

wsad1 commented Sep 30, 2022

Yeah it would be nice to mention it there.

@wsad1 wsad1 enabled auto-merge (squash) October 1, 2022 05:29
@wsad1 wsad1 disabled auto-merge October 1, 2022 05:32
@wsad1
Copy link
Member

wsad1 commented Oct 1, 2022

I don't think the failing tests are not related to this PR. Sorry about that. Will fix them soon.

Copy link
Contributor

@lightaime lightaime left a comment

Choose a reason for hiding this comment

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

Awesome. Like it! Leave some minor comments.

torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Show resolved Hide resolved
EdisonLeeeee and others added 3 commits October 2, 2022 13:09
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
@github-actions github-actions bot added the utils label Oct 2, 2022
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Outdated Show resolved Hide resolved
torch_geometric/utils/augmentation.py Show resolved Hide resolved
test/utils/test_augmentation.py Outdated Show resolved Hide resolved
rusty1s and others added 5 commits October 4, 2022 06:41
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
@rusty1s rusty1s merged commit 947d71e into master Oct 5, 2022
@rusty1s rusty1s deleted the basic_aug branch October 5, 2022 01:10
JakubPietrakIntel pushed a commit to JakubPietrakIntel/pytorch_geometric that referenced this pull request Nov 25, 2022
* add basic augmentation methods

* doc-string

* test

* raises

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>

* fix

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>

* Update test/utils/test_augmentation.py

Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>

* update

* update test

* changelog

* update mask_feature

* README

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>

* update

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Guohao Li <lightaime@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test

* add fill_value

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>

* Update torch_geometric/utils/augmentation.py

Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>

* update

* fix test

Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
Co-authored-by: Guohao Li <lightaime@gmail.com>
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