Skip to content

Add dropout_node to torch_geometric.utils #5481

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

Merged
merged 13 commits into from
Sep 21, 2022

Conversation

EdisonLeeeee
Copy link
Contributor

This PR is my first attempt to add graph augmentation methods into PyG. As discussed in #5452, I start with a simple augmentation method DropNode proposed in Graph Contrastive Learning with Augmentations.

@codecov
Copy link

codecov bot commented Sep 20, 2022

Codecov Report

Merging #5481 (92a95af) into master (d3f35cb) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5481      +/-   ##
==========================================
+ Coverage   83.30%   83.31%   +0.01%     
==========================================
  Files         350      350              
  Lines       19049    19062      +13     
==========================================
+ Hits        15868    15881      +13     
  Misses       3181     3181              
Impacted Files Coverage Δ
torch_geometric/utils/__init__.py 100.00% <100.00%> (ø)
torch_geometric/utils/dropout.py 100.00% <100.00%> (ø)

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

@EdisonLeeeee
Copy link
Contributor Author

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.

Thanks for adding this. Can we also create a small test for this?

@EdisonLeeeee
Copy link
Contributor Author

Of course. Will add some tests after addressing your comments :)

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!

@rusty1s
Copy link
Member

rusty1s commented Sep 21, 2022

@EdisonLeeeee Can you also add the changes to CHANGELOG.md?

@EdisonLeeeee
Copy link
Contributor Author

@rusty1s done. Will add dropout_edge and deprecate dropout_adj in the next PR.

@rusty1s rusty1s merged commit ba039e4 into pyg-team:master Sep 21, 2022
jjpietrak pushed a commit to jjpietrak/pytorch_geometric that referenced this pull request Nov 25, 2022
* add dropout_node

* pass num_nodes to subgraph

* drop relabel_nodes argument

* Update torch_geometric/utils/dropout.py

Co-authored-by: Matthias Fey <[email protected]>

* Update torch_geometric/utils/dropout.py

Co-authored-by: Matthias Fey <[email protected]>

* Update torch_geometric/utils/dropout.py

Co-authored-by: Matthias Fey <[email protected]>

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

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

* update

* test

* changelog

Co-authored-by: Matthias Fey <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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.

2 participants