Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
7e49ccef
You need to sign in or sign up before continuing.
Unverified
Commit
7e49ccef
authored
Sep 22, 2023
by
Muhammed Fatih BALIN
Committed by
GitHub
Sep 22, 2023
Browse files
Update Labor sampler docs, add NeurIPS acceptance (#6369)
parent
7cc59bba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
11 deletions
+20
-11
python/dgl/dataloading/labor_sampler.py
python/dgl/dataloading/labor_sampler.py
+2
-2
python/dgl/graphbolt/impl/csc_sampling_graph.py
python/dgl/graphbolt/impl/csc_sampling_graph.py
+3
-2
python/dgl/graphbolt/impl/neighbor_sampler.py
python/dgl/graphbolt/impl/neighbor_sampler.py
+12
-4
python/dgl/sampling/labor.py
python/dgl/sampling/labor.py
+3
-3
No files found.
python/dgl/dataloading/labor_sampler.py
View file @
7e49ccef
...
@@ -28,8 +28,8 @@ from .base import BlockSampler
...
@@ -28,8 +28,8 @@ from .base import BlockSampler
class
LaborSampler
(
BlockSampler
):
class
LaborSampler
(
BlockSampler
):
"""Sampler that builds computational dependency of node representations via
"""Sampler that builds computational dependency of node representations via
labor sampling for multilayer GNN from
labor sampling for multilayer GNN from
the NeurIPS 2023 paper
`
(LA)
yer-
n
eigh
(BOR)
Sampling
:
Defusing Neighborhood Explosion in GNNs
`
La
yer-
N
eigh
bor
Sampling
--
Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`__
<https://arxiv.org/abs/2210.13339>`__
This sampler will make every node gather messages from a fixed number of
This sampler will make every node gather messages from a fixed number of
...
...
python/dgl/graphbolt/impl/csc_sampling_graph.py
View file @
7e49ccef
...
@@ -437,8 +437,9 @@ class CSCSamplingGraph:
...
@@ -437,8 +437,9 @@ class CSCSamplingGraph:
probs_name
:
Optional
[
str
]
=
None
,
probs_name
:
Optional
[
str
]
=
None
,
)
->
SampledSubgraphImpl
:
)
->
SampledSubgraphImpl
:
"""Sample neighboring edges of the given nodes and return the induced
"""Sample neighboring edges of the given nodes and return the induced
subgraph via layer-neighbor sampling from arXiv:2210.13339:
subgraph via layer-neighbor sampling from the NeurIPS 2023 paper
"Layer-Neighbor Sampling -- Defusing Neighborhood Explosion in GNNs"
`Layer-Neighbor Sampling -- Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`__
Parameters
Parameters
----------
----------
...
...
python/dgl/graphbolt/impl/neighbor_sampler.py
View file @
7e49ccef
...
@@ -122,6 +122,11 @@ class NeighborSampler(SubgraphSampler):
...
@@ -122,6 +122,11 @@ class NeighborSampler(SubgraphSampler):
@
functional_datapipe
(
"sample_layer_neighbor"
)
@
functional_datapipe
(
"sample_layer_neighbor"
)
class
LayerNeighborSampler
(
NeighborSampler
):
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
Layer-Neighbor sampler is responsible for sampling a subgraph from given
data. It returns an induced subgraph along with compacted information. In
data. It returns an induced subgraph along with compacted information. In
the context of a node classification task, the neighbor sampler directly
the context of a node classification task, the neighbor sampler directly
...
@@ -131,10 +136,13 @@ class LayerNeighborSampler(NeighborSampler):
...
@@ -131,10 +136,13 @@ class LayerNeighborSampler(NeighborSampler):
positive and negative node pairs, and employs these nodes as the seed nodes
positive and negative node pairs, and employs these nodes as the seed nodes
for subsequent steps.
for subsequent steps.
Implements the approach described in https://arxiv.org/abs/2210.13339,
Implements the approach described in Appendix A.3 of the paper. Similar to
Appendix A.3. Similar to dgl.dataloading.LaborSampler but this uses
dgl.dataloading.LaborSampler but this uses sequential poisson sampling
sequential poisson sampling instead of poisson sampling to keep the count
instead of poisson sampling to keep the count of sampled edges per vertex
of sampled edges per vertex deterministic.
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__
(
def
__init__
(
...
...
python/dgl/sampling/labor.py
View file @
7e49ccef
...
@@ -44,9 +44,9 @@ def sample_labors(
...
@@ -44,9 +44,9 @@ def sample_labors(
output_device
=
None
,
output_device
=
None
,
):
):
"""Sampler that builds computational dependency of node representations via
"""Sampler that builds computational dependency of node representations via
labor sampling for multilayer GNN from
labor sampling for multilayer GNN from
the NeurIPS 2023 paper
`
(LA)
yer-
n
eigh
(BOR)
Sampling
:
Defusing Neighborhood Explosion in GNNs
`
La
yer-
N
eigh
bor
Sampling
--
Defusing Neighborhood Explosion in GNNs
<https://arxiv.org/abs/2210.13339>`
<https://arxiv.org/abs/2210.13339>`
__
This sampler will make every node gather messages from a fixed number of neighbors
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
per edge type. The neighbors are picked uniformly with default parameters. For every vertex t
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment