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 LinkNeighborLoader to Pytorch Lightning datamodule #4868

Merged
merged 20 commits into from
Jun 29, 2022
Merged

Conversation

ar104
Copy link
Contributor

@ar104 ar104 commented Jun 26, 2022

Extend the pytorch lightning datamodule to support wrapping the link neighbor loader.

@codecov
Copy link

codecov bot commented Jun 27, 2022

Codecov Report

Merging #4868 (3e7c7e2) into master (65ab1e0) will decrease coverage by 0.13%.
The diff coverage is 26.66%.

@@            Coverage Diff             @@
##           master    #4868      +/-   ##
==========================================
- Coverage   82.76%   82.62%   -0.14%     
==========================================
  Files         329      329              
  Lines       17709    17748      +39     
==========================================
+ Hits        14656    14665       +9     
- Misses       3053     3083      +30     
Impacted Files Coverage Δ
torch_geometric/data/lightning_datamodule.py 33.75% <23.25%> (-3.75%) ⬇️
torch_geometric/data/__init__.py 100.00% <100.00%> (ø)
torch_geometric/loader/link_neighbor_loader.py 92.53% <100.00%> (+0.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 65ab1e0...3e7c7e2. Read the comment docs.

@ar104 ar104 changed the title Add neighbor loader to pytorch Add neighbor loader to pytorch lightning datamodule. Jun 27, 2022
@ar104 ar104 changed the title Add neighbor loader to pytorch lightning datamodule. Add link neighbor loader to pytorch lightning datamodule. Jun 27, 2022
@ar104 ar104 requested a review from rusty1s June 27, 2022 03:52
@rusty1s rusty1s changed the title Add link neighbor loader to pytorch lightning datamodule. Add LinkNeighborLoader to Pytorch Lightning datamodule Jun 27, 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.

@ar104 I think this generally looks good although I would prefer to move this functionality to its own module, e.g., LightningLinkData. Otherwise, I feel the interface of input_nodes might become a bit confusing to you. WDYT?

@ar104 ar104 marked this pull request as ready for review June 27, 2022 16:18
@ar104
Copy link
Contributor Author

ar104 commented Jun 27, 2022

@ar104 I think this generally looks good although I would prefer to move this functionality to its own module, e.g., LightningLinkData. Otherwise, I feel the interface of input_nodes might become a bit confusing to you. WDYT?

Done.

Comment on lines 379 to 381
input_train_edges: InputEdges = None,
input_val_edges: InputEdges = None,
input_test_edges: InputEdges = None,
Copy link
Member

Choose a reason for hiding this comment

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

It's unclear what would happen when train/test/val edges are None. If input_val_edges or input_test_edges are None then all edges would be considered.

Copy link
Member

Choose a reason for hiding this comment

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

+1. I would be okay to make them required for now, and add a TODO to revisit this later on.

torch_geometric/data/lightning_datamodule.py Outdated Show resolved Hide resolved
torch_geometric/data/lightning_datamodule.py Outdated Show resolved Hide resolved
torch_geometric/data/lightning_datamodule.py Outdated Show resolved Hide resolved
torch_geometric/data/lightning_datamodule.py Outdated Show resolved Hide resolved
Comment on lines 379 to 381
input_train_edges: InputEdges = None,
input_val_edges: InputEdges = None,
input_test_edges: InputEdges = None,
Copy link
Member

Choose a reason for hiding this comment

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

+1. I would be okay to make them required for now, and add a TODO to revisit this later on.

torch_geometric/data/lightning_datamodule.py Show resolved Hide resolved
test/data/test_lightning_datamodule.py Show resolved Hide resolved
ar104 and others added 4 commits June 29, 2022 10:55
@ar104 ar104 merged commit 6c3c235 into master Jun 29, 2022
@ar104 ar104 deleted the edge_lightning branch June 29, 2022 17:47
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.

3 participants