-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: main
Are you sure you want to change the base?
Conversation
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.51% 90.16% +0.65%
==========================================
Files 126 130 +4
Lines 3518 3732 +214
==========================================
+ Hits 3149 3365 +216
+ Misses 369 367 -2 ☔ View full report in Codecov by Sentry. |
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.