-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*Issue #, if available:* *Description of changes:* This PR sets up the new documentation generation mechanism, create new API doc rst files, and modify existing Python code for doc files. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Theodore Vasiloudis <[email protected]>
- Loading branch information
1 parent
c63fb1f
commit 1c06aac
Showing
19 changed files
with
342 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the OS, Python version and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.9" | ||
|
||
# Build documentation in the "docs/" directory with Sphinx | ||
sphinx: | ||
configuration: docs/source/conf.py | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
# formats: | ||
# - epub | ||
|
||
# Optional but recommended, declare the Python requirements required | ||
# to build your documentation | ||
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html | ||
python: | ||
install: | ||
- method: pip | ||
path: . | ||
- requirements: docs/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
sphinx==7.1.2 | ||
sphinx-rtd-theme==1.3.0 | ||
--extra-index-url https://download.pytorch.org/whl/cpu | ||
torch==1.13.1+cpu | ||
-f https://data.dgl.ai/wheels-internal/repo.html | ||
dgl==1.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.. role:: hidden | ||
:class: hidden-section | ||
.. currentmodule:: {{ module }} | ||
|
||
|
||
{{ name | underline}} | ||
|
||
.. autoclass:: {{ name }} | ||
:show-inheritance: | ||
:members: prepare_data, get_node_feats, get_edge_feats, get_labels, forward, get_sparse_params, | ||
get_general_dense_parameters, get_lm_dense_parameters, save_model, remove_saved_model, | ||
save_topk_models, get_best_model_path, restore_model, fit, eval, infer, evaluate, | ||
do_eval, compute_score, predict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.. _apicustomized: | ||
|
||
customized model APIs | ||
========================== | ||
|
||
GraphStorm provides a set of APIs for users to integrate their own customized models with | ||
the framework of GraphStorm, so that users' own models can leverage GraphStorm's easy-to-use | ||
and distributed capabilities. | ||
|
||
For how to modify users' own models, please refer to this :ref:`Use Your Own Model Tutorial | ||
<use-own-models>`. | ||
|
||
In general, there are three sets of APIs involved in programming customized models. | ||
|
||
* Dataloaders: users need to extend GraphStorm's abstract node or edge dataloader to implement | ||
their own graph samplers or mini_batch generators. | ||
* Models: depending on specific GML tasks, users need to extend the corresponding ModelBase and | ||
ModelInterface, and then implement the required abstract functions. | ||
* Evaluators: if necessary, users can also extend the two evaluator templates to implement their | ||
own performance evaluation method. | ||
|
||
.. currentmodule:: graphstorm | ||
|
||
Dataloaders | ||
------------ | ||
.. autosummary:: | ||
:toctree: ../generated/ | ||
:nosignatures: | ||
:template: classtemplate.rst | ||
|
||
.. dataloading.AbsNodeDataLoader | ||
.. dataloading.AbsEdgeDataLoader | ||
Models | ||
------------ | ||
|
||
.. autosummary:: | ||
:toctree: ../generated/ | ||
:nosignatures: | ||
:template: classtemplate.rst | ||
|
||
model.GSgnnModelBase | ||
model.GSgnnNodeModelBase | ||
model.GSgnnEdgeModelBase | ||
model.GSgnnLinkPredictionModelBase | ||
model.GSgnnNodeModelInterface | ||
model.GSgnnEdgeModelInterface | ||
model.GSgnnLinkPredictionModelInterface | ||
|
||
Evaluators | ||
------------ | ||
|
||
If users want to implement customized evaluators or evaluation methods, a best practice is to | ||
extend the ``eval.GSgnnInstanceEvaluator`` class, and implement the abstract methods. | ||
|
||
.. autosummary:: | ||
:toctree: ../generated/ | ||
:nosignatures: | ||
:template: classtemplate.rst | ||
|
||
eval.GSgnnInstanceEvaluator | ||
eval.GSgnnLPEvaluator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.. _apidataloading: | ||
|
||
graphstorm.dataloading | ||
========================== | ||
|
||
GraphStorm dataloading module includes a set of graph datasets and dataloaders for different | ||
graph machine learning tasks. | ||
|
||
.. currentmodule:: graphstorm.dataloading | ||
|
||
DataSets | ||
------------ | ||
.. autosummary:: | ||
:toctree: ../generated/ | ||
:nosignatures: | ||
:template: classtemplate.rst | ||
|
||
GSgnnNodeTrainData | ||
GSgnnNodeInferData | ||
GSgnnEdgeTrainData | ||
GSgnnEdgeInferData | ||
|
||
Dataloaders | ||
------------ | ||
.. autosummary:: | ||
:toctree: ../generated/ | ||
:nosignatures: | ||
:template: classtemplate.rst | ||
|
||
GSgnnNodeDataLoader | ||
GSgnnEdgeDataLoader | ||
GSgnnLinkPredictionDataLoader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.. _apievaluator: | ||
|
||
graphstorm.evaluator | ||
======================= | ||
|
||
GraphStorm evaluators provides built-in evaluation methods for different Graph Machine | ||
Learning (GML). | ||
|
||
.. currentmodule:: graphstorm.eval | ||
.. autosummary:: | ||
:toctree: ../generated/ | ||
:nosignatures: | ||
:template: classtemplate.rst | ||
|
||
GSgnnLPEvaluator | ||
GSgnnMrrLPEvaluator | ||
GSgnnPerEtypeMrrLPEvaluator | ||
GSgnnAccEvaluator | ||
GSgnnRegressionEvaluator | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.. _apiinferer: | ||
|
||
graphstorm.inferer | ||
==================== | ||
|
||
GraphStorm inferers assemble the distributed inference pipeline for different tasks. | ||
|
||
If possible, users should always use these inferers to avoid handling the distributed | ||
processing and tasks. | ||
|
||
.. currentmodule:: graphstorm.inference | ||
|
||
.. autosummary:: | ||
:toctree: ../generated/ | ||
:nosignatures: | ||
:template: classtemplate.rst | ||
|
||
GSgnnLinkPredictionInfer | ||
GSgnnNodePredictionInfer | ||
GSgnnEdgePredictionInfer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.. _apimodel: | ||
|
||
graphstorm.model | ||
================= | ||
|
||
A GraphStorm model normally contains three components: | ||
|
||
* Input layer: a set of modules to convert input data for different use cases, | ||
e.g., embedding texture features. | ||
* Encoder: a set of Graph Neural Network modules | ||
* Decoder: a set of modules to convert results from encoders for different tasks, | ||
e.g., classification, regression, or link prediction. | ||
|
||
.. currentmodule:: graphstorm.model | ||
|
||
Model input layers | ||
------------------- | ||
.. autosummary:: | ||
:toctree: ../generated/ | ||
:nosignatures: | ||
:template: classtemplate.rst | ||
|
||
GSNodeEncoderInputLayer | ||
GSLMNodeEncoderInputLayer | ||
GSPureLMNodeInputLayer | ||
|
||
Model encoders and layers | ||
-------------------------- | ||
.. autosummary:: | ||
:toctree: ../generated/ | ||
:nosignatures: | ||
:template: classtemplate.rst | ||
|
||
RelationalGCNEncoder | ||
RelGraphConvLayer | ||
RelationalGATEncoder | ||
RelationalAttLayer | ||
SAGEEncoder | ||
SAGEConv | ||
HGTEncoder | ||
HGTLayer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.. _apigraphstorm: | ||
|
||
.. currentmodule:: graphstorm | ||
|
||
graphstorm | ||
============ | ||
|
||
The ``graphstorm`` package contains a set of functions for environment setup. | ||
Users can directly use the following code to use these functions. | ||
|
||
>>> import graphstorm as gs | ||
>>> gs.initialize() | ||
>>> gs.get_rank() | ||
|
||
.. autosummary:: | ||
:toctree: ../generated/ | ||
|
||
gsf.initialize | ||
gsf.get_feat_size | ||
utils.get_rank | ||
utils.get_world_size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.. _apitrainer: | ||
|
||
graphstorm.trainer | ||
===================== | ||
|
||
GraphStorm trainers assemble the distributed training pipeline for different tasks or | ||
different training methods. | ||
|
||
If possible, users should always use these trainers to avoid handling the distributed | ||
processing and tasks. | ||
|
||
.. currentmodule:: graphstorm.trainer | ||
|
||
|
||
Base class | ||
-------------- | ||
.. autosummary:: | ||
:toctree: ../generated/ | ||
:nosignatures: | ||
:template: classtemplate.rst | ||
|
||
GSgnnTrainer | ||
|
||
Task classes | ||
----------------- | ||
.. autosummary:: | ||
:toctree: ../generated/ | ||
:nosignatures: | ||
:template: classtemplate.rst | ||
|
||
GSgnnLinkPredictionTrainer | ||
GSgnnNodePredictionTrainer | ||
GSgnnEdgePredictionTrainer | ||
|
||
Method classes | ||
----------------- | ||
.. autosummary:: | ||
:toctree: ../generated/ | ||
:nosignatures: | ||
:template: classtemplate.rst | ||
|
||
GLEMNodePredictionTrainer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.