-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Bi-directional Sampling for NeighborSampler #10126
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
base: master
Are you sure you want to change the base?
Bi-directional Sampling for NeighborSampler #10126
Conversation
37688a8
to
7ba87d5
Compare
looks good so far |
While working on [this PR](#10126), I noticed that there are no sanity tests for the default NeighborSampler. Although NeigborLoader effectively tests a lot of this functionality, having lower level tests helps with ensuring consistency for each `sample` call of the sampler, without the batching logic of `NeighborLoader` getting involved. --------- Co-authored-by: Zack Aristei <[email protected]> Co-authored-by: Rishi Puri <[email protected]>
fdf6450
to
c9eab32
Compare
d2506c8
to
9adc7b9
Compare
closing since matthias said theres an existing simple way to do this. please jsut put the fix into my branch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but i will request that @akihironitta or @rusty1s review this
e288d28
to
d99fb71
Compare
#10200 should be merged first |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10126 +/- ##
==========================================
- Coverage 86.11% 85.46% -0.65%
==========================================
Files 496 496
Lines 33655 34129 +474
==========================================
+ Hits 28981 29169 +188
- Misses 4674 4960 +286 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…rectional-sampler
e6b47d0
to
a2c6b11
Compare
# Conflicts: # test/sampler/test_sampler_base.py # torch_geometric/sampler/base.py
889e316
to
f5333cf
Compare
# Conflicts: # test/sampler/test_sampler_base.py
This PR makes the following changes:
src
todst
node, and not just fromdst
tosrc
node, which is the current default behavior.BidirectionalNeighborSampler
, which samples nodes/edges in both upstream and downstream directions for a directed graph, as if it were an undirected graph.merge_with
andcollate
methods to the SamplerOutput dataclass, allowing for different SamplerOutputs to be merged together. This also becomes useful in scenarios where the user may want to sample using multiple different unique sampling methods.This PR will remain in draft until
methods are also implemented on the corresponding Hetero graph classes, andunittests have been written to cover new behaviors.UPDATE: Hetero Bidirectional Sampler and SamplerOutput merge will be a separate PR.