Unverified Commit 463807c5 authored by Da Zheng's avatar Da Zheng Committed by GitHub
Browse files

[Doc] indexing missing docs. (#625)

* add doc of NodeFlow.

* add missing API in nodeflow.

* add docs and two more API to NodeFlow.

* add more docs.

* fix.

* fix.

* fix.

* add docs for distributed sampler.
parent 5549c70d
.. _apigraphstore:
Graph Store -- Graph for multi-processing and distributed training
==================================================================
.. currentmodule:: dgl.contrib.graph_store
.. autoclass:: SharedMemoryDGLGraph
Querying the distributed setting
------------------------
.. autosummary::
:toctree: ../../generated/
SharedMemoryDGLGraph.num_workers
SharedMemoryDGLGraph.worker_id
SharedMemoryDGLGraph.destroy
Using Node/edge features
------------------------
.. autosummary::
:toctree: ../../generated/
SharedMemoryDGLGraph.init_ndata
SharedMemoryDGLGraph.init_edata
Computing with Graph store
-----------------------
.. autosummary::
:toctree: ../../generated/
SharedMemoryDGLGraph.apply_nodes
SharedMemoryDGLGraph.apply_edges
SharedMemoryDGLGraph.group_apply_edges
SharedMemoryDGLGraph.recv
SharedMemoryDGLGraph.send_and_recv
SharedMemoryDGLGraph.pull
SharedMemoryDGLGraph.push
SharedMemoryDGLGraph.update_all
Construct a graph store
-----------------------
.. autofunction:: dgl.contrib.graph_store.create_graph_store_server
.. autofunction:: dgl.contrib.graph_store.create_graph_from_store
...@@ -16,3 +16,5 @@ API Reference ...@@ -16,3 +16,5 @@ API Reference
transform transform
nn nn
subgraph subgraph
graph_store
nodeflow
.. _apinodeflow:
NodeFlow -- Graph sampled from a large graph
=========================================
.. currentmodule:: dgl
.. autoclass:: NodeFlow
Querying graph structure
------------------------
.. autosummary::
:toctree: ../../generated/
NodeFlow.num_layers
NodeFlow.num_blocks
NodeFlow.layer_size
NodeFlow.block_size
NodeFlow.layer_in_degree
NodeFlow.layer_out_degree
NodeFlow.layer_nid
NodeFlow.layer_parent_nid
NodeFlow.block_eid
NodeFlow.block_parent_eid
NodeFlow.block_edges
Converting to other format
-------------------------------
.. autosummary::
:toctree: ../../generated/
NodeFlow.block_adjacency_matrix
NodeFlow.block_incidence_matrix
Using Node/edge features
------------------------
.. autosummary::
:toctree: ../../generated/
NodeFlow.layers
NodeFlow.blocks
NodeFlow.set_n_initializer
NodeFlow.set_e_initializer
NodeFlow.node_attr_schemes
NodeFlow.edge_attr_schemes
Mapping between NodeFlow and parent graph
-----------------------------------------
.. autosummary::
:toctree: ../../generated/
NodeFlow.map_to_parent_nid
NodeFlow.map_to_parent_eid
NodeFlow.map_from_parent_nid
Synchronize features between NodeFlow and parent graph
------------------------------------------------------
.. autosummary::
:toctree: ../../generated/
NodeFlow.copy_from_parent
NodeFlow.copy_to_parent
Computing with NodeFlow
-----------------------
.. autosummary::
:toctree: ../../generated/
NodeFlow.register_message_func
NodeFlow.register_reduce_func
NodeFlow.register_apply_node_func
NodeFlow.register_apply_edge_func
NodeFlow.apply_layer
NodeFlow.apply_block
NodeFlow.block_compute
NodeFlow.prop_flow
...@@ -4,3 +4,32 @@ Graph samplers ...@@ -4,3 +4,32 @@ Graph samplers
============== ==============
.. autofunction:: dgl.contrib.sampling.sampler.NeighborSampler .. autofunction:: dgl.contrib.sampling.sampler.NeighborSampler
.. autofunction:: dgl.contrib.sampling.sampler.LayerSampler
Distributed sampler
------------------------
.. currentmodule:: dgl.contrib.sampling.dis_sampler
.. autoclass:: SamplerPool
.. autosummary::
:toctree: ../../generated/
SamplerPool.start
SamplerPool.worker
.. autoclass:: SamplerSender
.. autosummary::
:toctree: ../../generated/
SamplerSender.send
SamplerSender.signal
.. autoclass:: SamplerReceiver
.. autosummary::
:toctree: ../../generated/
SamplerReceiver.__iter__
SamplerReceiver.__next__
...@@ -128,6 +128,44 @@ class NodeFlow(DGLBaseGraph): ...@@ -128,6 +128,44 @@ class NodeFlow(DGLBaseGraph):
""" """
return BlockView(self) return BlockView(self)
def node_attr_schemes(self, layer_id):
"""Return the node feature schemes.
Each feature scheme is a named tuple that stores the shape and data type
of the node feature
Parameters
----------
layer_id : int
the specified layer to get node data scheme.
Returns
-------
dict of str to schemes
The schemes of node feature columns.
"""
layer_id = self._get_layer_id(layer_id)
return self._node_frames[layer_id].schemes
def edge_attr_schemes(self, block_id):
"""Return the edge feature schemes.
Each feature scheme is a named tuple that stores the shape and data type
of the node feature
Parameters
----------
block_id : int
the specified block to get edge data scheme.
Returns
-------
dict of str to schemes
The schemes of edge feature columns.
"""
block_id = self._get_block_id(block_id)
return self._edge_frames[block_id].schemes
def layer_size(self, layer_id): def layer_size(self, layer_id):
"""Return the number of nodes in a specified layer. """Return the number of nodes in a specified layer.
......
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