-
Notifications
You must be signed in to change notification settings - Fork 15
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
Added batching in transductive setting #128
Open
Coerulatus
wants to merge
29
commits into
main
Choose a base branch
from
batching
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #128 +/- ##
==========================================
+ Coverage 89.61% 90.24% +0.62%
==========================================
Files 129 133 +4
Lines 3670 3884 +214
==========================================
+ Hits 3289 3505 +216
+ Misses 381 379 -2 ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello everyone,
I have added the possibility of batching the data in the transductive setting.
When working with large graphs, selecting a subset of the graph while keeping the model's performance unchanged for the desired nodes can drastically reduce the memory requirements during training and inference.
In torch_geometric, the
NeighborLoader
performs neighbor sampling to achieve this. This can be done because, in the normal message-passing framework, the information propagates only as far as the number of message-passing steps performed.The newly added
NeighborCellsLoader
works similarly but it also selects the relevant higher-order cells, by sequentially reducing all the incidences.In the loader, you can also specify the rank to consider, meaning that you can perform batching over the nodes, edges, or any higher-order cell.
I have also added a tutorial that shows the basic functionality of
NeighborCellsLoader
. It also tests that the approach works as expected by comparing the model's outputs working with the full graph or with the batched one. Interestingly the number of hops needed is not necessarily equal to the number of layers in the higher-order networks. Information, at each layer, can in general travel further than the 1-neighborhood when working with these models.