Unverified Commit 1f7b2195 authored by Quan (Andy) Gan's avatar Quan (Andy) Gan Committed by GitHub
Browse files

[Doc] User guide section 5 and 6 (#2029)

* [Doc] User guide section 5 and 6

* oops

* fix
parent 2fc280ba
...@@ -78,6 +78,21 @@ Using Node/edge features ...@@ -78,6 +78,21 @@ Using Node/edge features
DGLHeteroGraph.local_var DGLHeteroGraph.local_var
DGLHeteroGraph.local_scope DGLHeteroGraph.local_scope
Using Node/edge features for blocks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please refer to :ref:`guide-minibatch` for the definition of blocks.
.. autosummary::
:toctree: ../../generated/
DGLHeteroGraph.number_of_src_nodes
DGLHeteroGraph.number_of_dst_nodes
DGLHeteroGraph.srcnodes
DGLHeteroGraph.srcdata
DGLHeteroGraph.dstnodes
DGLHeteroGraph.dstdata
Transforming graph Transforming graph
------------------ ------------------
...@@ -88,6 +103,7 @@ Transforming graph ...@@ -88,6 +103,7 @@ Transforming graph
DGLHeteroGraph.edge_subgraph DGLHeteroGraph.edge_subgraph
DGLHeteroGraph.node_type_subgraph DGLHeteroGraph.node_type_subgraph
DGLHeteroGraph.edge_type_subgraph DGLHeteroGraph.edge_type_subgraph
DGLHeteroGraph.__getitem__
Computing with DGLHeteroGraph Computing with DGLHeteroGraph
----------------------------- -----------------------------
......
...@@ -30,6 +30,8 @@ General collating functions ...@@ -30,6 +30,8 @@ General collating functions
.. autoclass:: EdgeCollator .. autoclass:: EdgeCollator
:members: dataset, collate :members: dataset, collate
.. _api-dataloading-neighbor-sampling:
Neighborhood Sampling Classes Neighborhood Sampling Classes
----------------------------- -----------------------------
...@@ -45,7 +47,7 @@ Uniform Node-wise Neighbor Sampling (GraphSAGE style) ...@@ -45,7 +47,7 @@ Uniform Node-wise Neighbor Sampling (GraphSAGE style)
.. autoclass:: MultiLayerNeighborSampler .. autoclass:: MultiLayerNeighborSampler
:members: sample_frontier :members: sample_frontier
.. _negative-sampling: .. _api-dataloading-negative-sampling:
Negative Samplers for Link Prediction Negative Samplers for Link Prediction
------------------------------------- -------------------------------------
......
...@@ -22,6 +22,8 @@ Graph Create Ops ...@@ -22,6 +22,8 @@ Graph Create Ops
knn_graph knn_graph
segmented_knn_graph segmented_knn_graph
.. _api-subgraph-extraction:
Subgraph Extraction Routines Subgraph Extraction Routines
------------------------------------- -------------------------------------
......
...@@ -186,6 +186,15 @@ Set2Set ...@@ -186,6 +186,15 @@ Set2Set
:members: :members:
:show-inheritance: :show-inheritance:
Heterogeneous Graph Convolution Module
----------------------------------------
HeteroGraphConv
~~~~~~~~~~~~~~~
.. autoclass:: dgl.nn.mxnet.HeteroGraphConv
:members:
:show-inheritance:
Utility Modules Utility Modules
---------------------------------------- ----------------------------------------
......
...@@ -222,6 +222,16 @@ SetTransformerDecoder ...@@ -222,6 +222,16 @@ SetTransformerDecoder
:members: :members:
:show-inheritance: :show-inheritance:
Heterogeneous Graph Convolution Module
----------------------------------------
HeteroGraphConv
~~~~~~~~~~~~~~~
.. autoclass:: dgl.nn.pytorch.HeteroGraphConv
:members:
:show-inheritance:
Utility Modules Utility Modules
---------------------------------------- ----------------------------------------
......
...@@ -106,3 +106,13 @@ GlobalAttentionPooling ...@@ -106,3 +106,13 @@ GlobalAttentionPooling
.. autoclass:: dgl.nn.tensorflow.glob.GlobalAttentionPooling .. autoclass:: dgl.nn.tensorflow.glob.GlobalAttentionPooling
:members: :members:
:show-inheritance: :show-inheritance:
Heterogeneous Graph Convolution Module
----------------------------------------
HeteroGraphConv
~~~~~~~~~~~~~~~
.. autoclass:: dgl.nn.tensorflow.HeteroGraphConv
:members:
:show-inheritance:
.. _guide-data-pipeline:
Graph data input pipeline in DGL Graph data input pipeline in DGL
================================== ==================================
......
.. _guide-message-passing:
Message Passing Message Passing
=============== ===============
...@@ -288,4 +290,4 @@ string represents the cross type reducer. The reducer can be one of ...@@ -288,4 +290,4 @@ string represents the cross type reducer. The reducer can be one of
# Trigger message passing of multiple types. # Trigger message passing of multiple types.
G.multi_update_all(funcs, 'sum') G.multi_update_all(funcs, 'sum')
# return the updated node feature dictionary # return the updated node feature dictionary
return {ntype : G.nodes[ntype].data['h'] for ntype in G.ntypes} return {ntype : G.nodes[ntype].data['h'] for ntype in G.ntypes}
\ No newline at end of file
This diff is collapsed.
Build DGL NN Module .. _guide-nn:
===================
Building DGL NN Module
======================
DGL NN module is the building block for your GNN model. It inherents DGL NN module is the building block for your GNN model. It inherents
from `Pytorch’s NN Module <https://pytorch.org/docs/1.2.0/_modules/torch/nn/modules/module.html>`__, `MXNet Gluon’s NN Blcok <http://mxnet.incubator.apache.org/versions/1.6/api/python/docs/api/gluon/nn/index.html>`__ and `TensorFlow’s Keras from `Pytorch’s NN Module <https://pytorch.org/docs/1.2.0/_modules/torch/nn/modules/module.html>`__, `MXNet Gluon’s NN Block <http://mxnet.incubator.apache.org/versions/1.6/api/python/docs/api/gluon/nn/index.html>`__ and `TensorFlow’s Keras
Layer <https://www.tensorflow.org/api_docs/python/tf/keras/layers>`__, depending on the DNN framework backend we are using. In DGL NN Layer <https://www.tensorflow.org/api_docs/python/tf/keras/layers>`__, depending on the DNN framework backend we are using. In DGL NN
module, the parameter registration in construction function and tensor module, the parameter registration in construction function and tensor
operation in forward function are the same with the backend framework. operation in forward function are the same with the backend framework.
...@@ -264,8 +266,7 @@ The code actually does message passing and reducing computing. This part ...@@ -264,8 +266,7 @@ The code actually does message passing and reducing computing. This part
of code varies module by module. Note that all the message passings in of code varies module by module. Note that all the message passings in
the above code are implemented using ``update_all()`` API and the above code are implemented using ``update_all()`` API and
``built-in`` message/reduce functions to fully utilize DGL’s performance ``built-in`` message/reduce functions to fully utilize DGL’s performance
optimization as described in the `Message Passing User Guide optimization as described in :ref:`guide-message-passing`.
Section <https://docs.dgl.ai/guide/message.html>`__.
Update feature after reducing for output Update feature after reducing for output
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
This diff is collapsed.
...@@ -435,7 +435,7 @@ class EdgeCollator(Collator): ...@@ -435,7 +435,7 @@ class EdgeCollator(Collator):
or a dictionary of edge types and such pairs if the graph is heterogenenous. or a dictionary of edge types and such pairs if the graph is heterogenenous.
A set of builtin negative samplers are provided in A set of builtin negative samplers are provided in
:ref:`the negative sampling module <negative-sampling>`. :ref:`the negative sampling module <api-dataloading-negative-sampling>`.
Examples Examples
-------- --------
......
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