Skip to content

Commit

Permalink
Update Labor sampler docs, add NeurIPS acceptance (#6369)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfbalin committed Sep 22, 2023
1 parent 7cc59bb commit 7e49cce
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions python/dgl/dataloading/labor_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

class LaborSampler(BlockSampler):
"""Sampler that builds computational dependency of node representations via
labor sampling for multilayer GNN from
`(LA)yer-neigh(BOR) Sampling: Defusing Neighborhood Explosion in GNNs
labor sampling for multilayer GNN from the NeurIPS 2023 paper
`Layer-Neighbor Sampling -- Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`__
This sampler will make every node gather messages from a fixed number of
Expand Down
5 changes: 3 additions & 2 deletions python/dgl/graphbolt/impl/csc_sampling_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,9 @@ def sample_layer_neighbors(
probs_name: Optional[str] = None,
) -> SampledSubgraphImpl:
"""Sample neighboring edges of the given nodes and return the induced
subgraph via layer-neighbor sampling from arXiv:2210.13339:
"Layer-Neighbor Sampling -- Defusing Neighborhood Explosion in GNNs"
subgraph via layer-neighbor sampling from the NeurIPS 2023 paper
`Layer-Neighbor Sampling -- Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`__
Parameters
----------
Expand Down
16 changes: 12 additions & 4 deletions python/dgl/graphbolt/impl/neighbor_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ def _sample_subgraphs(self, seeds):
@functional_datapipe("sample_layer_neighbor")
class LayerNeighborSampler(NeighborSampler):
"""
Sampler that builds computational dependency of node representations via
labor sampling for multilayer GNN from the NeurIPS 2023 paper
`Layer-Neighbor Sampling -- Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`__
Layer-Neighbor sampler is responsible for sampling a subgraph from given
data. It returns an induced subgraph along with compacted information. In
the context of a node classification task, the neighbor sampler directly
Expand All @@ -131,10 +136,13 @@ class LayerNeighborSampler(NeighborSampler):
positive and negative node pairs, and employs these nodes as the seed nodes
for subsequent steps.
Implements the approach described in https://arxiv.org/abs/2210.13339,
Appendix A.3. Similar to dgl.dataloading.LaborSampler but this uses
sequential poisson sampling instead of poisson sampling to keep the count
of sampled edges per vertex deterministic.
Implements the approach described in Appendix A.3 of the paper. Similar to
dgl.dataloading.LaborSampler but this uses sequential poisson sampling
instead of poisson sampling to keep the count of sampled edges per vertex
deterministic like NeighborSampler. Thus, it is a drop-in replacement for
NeighborSampler. However, unlike NeighborSampler, it samples fewer vertices
and edges for multilayer GNN scenario without harming convergence speed with
respect to training iterations.
"""

def __init__(
Expand Down
6 changes: 3 additions & 3 deletions python/dgl/sampling/labor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def sample_labors(
output_device=None,
):
"""Sampler that builds computational dependency of node representations via
labor sampling for multilayer GNN from
`(LA)yer-neigh(BOR) Sampling: Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`
labor sampling for multilayer GNN from the NeurIPS 2023 paper
`Layer-Neighbor Sampling -- Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`__
This sampler will make every node gather messages from a fixed number of neighbors
per edge type. The neighbors are picked uniformly with default parameters. For every vertex t
Expand Down

0 comments on commit 7e49cce

Please sign in to comment.