Skip to content

Commit

Permalink
[Doc] add figures for explanation (dmlc#807)
Browse files Browse the repository at this point in the history
* fix.

* update
  • Loading branch information
zheng-da authored and yzh119 committed Aug 28, 2019
1 parent 1b5820a commit 1c9c033
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/dgl/contrib/sampling/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class NeighborSampler(NodeFlowSampler):
layer :math:`i+1` are in layer :math:`i`. All the edges are from nodes
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
of the initial seed nodes (number of nodes in the last layer).
Expand Down
12 changes: 8 additions & 4 deletions python/dgl/nodeflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,17 @@ class NodeFlow(DGLBaseGraph):
sampling and Layer-wise sampling.
These sampling algorithms generate graphs with multiple layers. The
edges connect the nodes between two layers while there don't exist
edges between the nodes in the same layer.
We store multiple layers of the sampling results in a single graph.
edges connect the nodes between two layers, which forms *blocks*, while
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
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
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
generate NodeFlow instead.
Expand Down

0 comments on commit 1c9c033

Please sign in to comment.