"...pytorch/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "a24a38bcb096e8873e56cd1d57129c733321e96a"
Unverified Commit 100eb57c authored by Quan (Andy) Gan's avatar Quan (Andy) Gan Committed by GitHub
Browse files

[Doc] Fix random_walk documentation inconsistency (#3188)



* Update randomwalks.py

* Update randomwalks.py

FIx lint
Co-authored-by: default avatarJinjing Zhou <VoVAllen@users.noreply.github.com>
parent 0e90d045
...@@ -15,12 +15,15 @@ def random_walk(g, nodes, *, metapath=None, length=None, prob=None, restart_prob ...@@ -15,12 +15,15 @@ def random_walk(g, nodes, *, metapath=None, length=None, prob=None, restart_prob
return_eids=False): return_eids=False):
"""Generate random walk traces from an array of starting nodes based on the given metapath. """Generate random walk traces from an array of starting nodes based on the given metapath.
For a single starting node, ``num_traces`` traces would be generated. A trace would Each starting node will have one trace generated, which
1. Start from the given node and set ``t`` to 0. 1. Start from the given node and set ``t`` to 0.
2. Pick and traverse along edge type ``metapath[t]`` from the current node. 2. Pick and traverse along edge type ``metapath[t]`` from the current node.
3. If no edge can be found, halt. Otherwise, increment ``t`` and go to step 2. 3. If no edge can be found, halt. Otherwise, increment ``t`` and go to step 2.
To generate multiple traces for a single node, you can specify the same node multiple
times.
The returned traces all have length ``len(metapath) + 1``, where the first node The returned traces all have length ``len(metapath) + 1``, where the first node
is the starting node itself. is the starting node itself.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment