"examples/git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "fc6090e96b37a528b051aa6747e6233354b5a3ef"
Commit 5680f8dc authored by Gan Quan's avatar Gan Quan Committed by Minjie Wang
Browse files

[DOC] Documentation strings for graph mutation, queries, and subgraphing (#207)

* docstrings for graph mutation & queries

* [Doc] contrib.sampler. (#200)

* subgraph docs

* updates
parent 57daf9c9
...@@ -10,4 +10,5 @@ API Reference ...@@ -10,4 +10,5 @@ API Reference
traversal traversal
propagate propagate
udf udf
sampler
data data
.. apisampler
Sampling subgraphs from a large graph
=====================================
.. currentmodule:: dgl.contrib.sampling
NeighborSampler
---------------
A function that generates a subgraph loader for sampling subgraphs.
...@@ -102,7 +102,8 @@ def NeighborSampler(g, batch_size, expand_factor, num_hops=1, ...@@ -102,7 +102,8 @@ def NeighborSampler(g, batch_size, expand_factor, num_hops=1,
node_prob: the probability that a neighbor node is sampled. node_prob: the probability that a neighbor node is sampled.
1D Tensor. None means uniform sampling. Otherwise, the number of elements 1D Tensor. None means uniform sampling. Otherwise, the number of elements
should be the same as the number of vertices in the graph. should be the same as the number of vertices in the graph.
seed_nodes: a list of nodes where we sample subgraphs from. If it's None, the seed vertices are all vertices in the graph. seed_nodes: a list of nodes where we sample subgraphs from.
If it's None, the seed vertices are all vertices in the graph.
shuffle: indicates the sampled subgraphs are shuffled. shuffle: indicates the sampled subgraphs are shuffled.
num_workers: the number of worker threads that sample subgraphs in parallel. num_workers: the number of worker threads that sample subgraphs in parallel.
max_subgraph_size: the maximal subgraph size in terms of the number of nodes. max_subgraph_size: the maximal subgraph size in terms of the number of nodes.
...@@ -110,7 +111,8 @@ def NeighborSampler(g, batch_size, expand_factor, num_hops=1, ...@@ -110,7 +111,8 @@ def NeighborSampler(g, batch_size, expand_factor, num_hops=1,
Returns Returns
------- -------
A subgraph generator. A subgraph loader that returns a batch of subgraphs and
the Ids of the seed vertices used in the batch.
''' '''
return NSSubgraphLoader(g, batch_size, expand_factor, num_hops, neighbor_type, node_prob, return NSSubgraphLoader(g, batch_size, expand_factor, num_hops, neighbor_type, node_prob,
seed_nodes, shuffle, num_workers, max_subgraph_size) seed_nodes, shuffle, num_workers, max_subgraph_size)
This diff is collapsed.
...@@ -29,7 +29,7 @@ class DGLSubGraph(DGLGraph): ...@@ -29,7 +29,7 @@ class DGLSubGraph(DGLGraph):
The "shared" mode is currently not supported. The "shared" mode is currently not supported.
The subgraph is read-only so mutation is not allowed. The subgraph is read-only on structure; graph mutation is not allowed.
Parameters Parameters
---------- ----------
......
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