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
1c9c0339
Commit
1c9c0339
authored
Aug 28, 2019
by
Da Zheng
Committed by
Zihao Ye
Aug 29, 2019
Browse files
[Doc] add figures for explanation (#807)
* fix. * update
parent
1b5820a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
python/dgl/contrib/sampling/sampler.py
python/dgl/contrib/sampling/sampler.py
+1
-1
python/dgl/nodeflow.py
python/dgl/nodeflow.py
+8
-4
No files found.
python/dgl/contrib/sampling/sampler.py
View file @
1c9c0339
...
@@ -222,7 +222,7 @@ class NeighborSampler(NodeFlowSampler):
...
@@ -222,7 +222,7 @@ class NeighborSampler(NodeFlowSampler):
layer :math:`i+1` are in layer :math:`i`. All the edges are from nodes
layer :math:`i+1` are in layer :math:`i`. All the edges are from nodes
in layer :math:`i` to layer :math:`i+1`.
in layer :math:`i` to layer :math:`i+1`.
TODO(minjie): give a figure here.
.. image:: https://s3.us-east-2.amazonaws.com/dgl.ai/tutorial/sampling/NodeFlow.png
As an analogy to mini-batch training, the ``batch_size`` here is equal to the number
As an analogy to mini-batch training, the ``batch_size`` here is equal to the number
of the initial seed nodes (number of nodes in the last layer).
of the initial seed nodes (number of nodes in the last layer).
...
...
python/dgl/nodeflow.py
View file @
1c9c0339
...
@@ -73,13 +73,17 @@ class NodeFlow(DGLBaseGraph):
...
@@ -73,13 +73,17 @@ class NodeFlow(DGLBaseGraph):
sampling and Layer-wise sampling.
sampling and Layer-wise sampling.
These sampling algorithms generate graphs with multiple layers. The
These sampling algorithms generate graphs with multiple layers. The
edges connect the nodes between two layers while there don't exist
edges connect the nodes between two layers, which forms *blocks*, while
edges between the nodes in the same layer.
there don't exist edges between the nodes in the same layer. As illustrated
in the figure, the last layer stores the target (seed) nodes where neighbors
We store multiple layers of the sampling results in a single graph.
are sampled from. Neighbors reached in different hops are placed in different
layers. Edges that connect to the neighbors in the next hop are placed
in a block.
We store extra information, such as the node and edge mapping from
We store extra information, such as the node and edge mapping from
the NodeFlow graph to the parent graph.
the NodeFlow graph to the parent graph.
.. image:: https://s3.us-east-2.amazonaws.com/dgl.ai/api/sampling.nodeflow.png
DO NOT create NodeFlow object directly. Use sampling method to
DO NOT create NodeFlow object directly. Use sampling method to
generate NodeFlow instead.
generate NodeFlow instead.
...
...
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