');
+ ul.append(entry);
+ obj[groupName] = ul;
+ }
+ });
+
+ return obj;
+ }
+
+
+
+ var customIndex = $('.custom-index');
+ customIndex.empty();
+
+
+ var selected = $('div.section>dl>dt');
+ if (selected.length === 0)
+ return;
+
+ var obj = createList(selected);
+ var block = $('');
+ for(var key in obj) {
+ var a = $('
');
+ a.html(key + ':');
+ block.append(a);
+ block.append(obj[key]);
+ }
+ customIndex.append(block);
+});
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html
new file mode 100644
index 000000000..86a1fd546
--- /dev/null
+++ b/docs/_templates/layout.html
@@ -0,0 +1,20 @@
+{% extends "!layout.html" %}
+
+{%- block extrahead %}
+
+
+
+
+{% endblock %}
diff --git a/docs/algo_docs/a3c.rst b/docs/algo_docs/a3c.rst
new file mode 100644
index 000000000..6da29abdf
--- /dev/null
+++ b/docs/algo_docs/a3c.rst
@@ -0,0 +1,14 @@
+Algorithms.a3c
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.algorithms.a3c
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/algo_docs/ddpg.rst b/docs/algo_docs/ddpg.rst
new file mode 100644
index 000000000..649ca2148
--- /dev/null
+++ b/docs/algo_docs/ddpg.rst
@@ -0,0 +1,14 @@
+Algorithms.ddpg
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.algorithms.ddpg
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/algo_docs/dqn.rst b/docs/algo_docs/dqn.rst
new file mode 100644
index 000000000..8bdd61e61
--- /dev/null
+++ b/docs/algo_docs/dqn.rst
@@ -0,0 +1,14 @@
+Algorithms.dqn
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.algorithms.dqn
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/algo_docs/impala/impala.rst b/docs/algo_docs/impala/impala.rst
new file mode 100644
index 000000000..5681b4524
--- /dev/null
+++ b/docs/algo_docs/impala/impala.rst
@@ -0,0 +1,14 @@
+Algorithms.impala
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.algorithms.impala.impala
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/algo_docs/impala/index.rst b/docs/algo_docs/impala/index.rst
new file mode 100644
index 000000000..c16a9e7e7
--- /dev/null
+++ b/docs/algo_docs/impala/index.rst
@@ -0,0 +1,8 @@
+Algorithms.impala
+=====================================
+
+.. toctree::
+ :maxdepth: 1
+
+ impala
+ vtrace
\ No newline at end of file
diff --git a/docs/algo_docs/impala/vtrace.rst b/docs/algo_docs/impala/vtrace.rst
new file mode 100644
index 000000000..b6c64aa61
--- /dev/null
+++ b/docs/algo_docs/impala/vtrace.rst
@@ -0,0 +1,14 @@
+Algorithms.vtrace
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.algorithms.impala.vtrace
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/algo_docs/index.rst b/docs/algo_docs/index.rst
new file mode 100644
index 000000000..51817c7c1
--- /dev/null
+++ b/docs/algo_docs/index.rst
@@ -0,0 +1,12 @@
+PARL.Algorithms
+=====================================
+
+.. toctree::
+ :maxdepth: 2
+
+ impala/index
+ a3c
+ ddpg
+ dqn
+ policy_gradient
+ ppo
\ No newline at end of file
diff --git a/docs/algo_docs/policy_gradient.rst b/docs/algo_docs/policy_gradient.rst
new file mode 100644
index 000000000..6f97ef9de
--- /dev/null
+++ b/docs/algo_docs/policy_gradient.rst
@@ -0,0 +1,14 @@
+Algorithms.policy_gradient
+----------------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.algorithms.policy_gradient
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/algo_docs/ppo.rst b/docs/algo_docs/ppo.rst
new file mode 100644
index 000000000..02a369b38
--- /dev/null
+++ b/docs/algo_docs/ppo.rst
@@ -0,0 +1,14 @@
+Algorithms.ppo
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.algorithms.ppo
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/api_docs/index.rst b/docs/api_docs/index.rst
deleted file mode 100644
index 71f92106a..000000000
--- a/docs/api_docs/index.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-.. PARL_docs documentation master file, created by
- sphinx-quickstart on Mon Apr 22 11:12:25 2019.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
-
-PARL Documentation
-=====================================
-
-.. toctree::
- :maxdepth: 1
-
- utils
diff --git a/docs/api_docs/utils.rst b/docs/api_docs/utils.rst
deleted file mode 100644
index 4142ccab9..000000000
--- a/docs/api_docs/utils.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-parl.Model
---------------------
-.. automodule:: parl.framework.model_base
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/docs/conf.py b/docs/conf.py
index f4985d692..489cabc9d 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -34,6 +34,9 @@
import os
import sys
import parl
+autodoc_mock_imports = ['paddle']
+sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, os.path.abspath('..'))
release = parl.__version__
project = 'PARL'
copyright = '2019, nlp-ol@baidu.com'
diff --git a/docs/framework_docs/agent_base.rst b/docs/framework_docs/agent_base.rst
new file mode 100644
index 000000000..5868b9977
--- /dev/null
+++ b/docs/framework_docs/agent_base.rst
@@ -0,0 +1,14 @@
+Framework.agent_base
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.framework.agent_base
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/framework_docs/algorithm_base.rst b/docs/framework_docs/algorithm_base.rst
new file mode 100644
index 000000000..a6694e1a5
--- /dev/null
+++ b/docs/framework_docs/algorithm_base.rst
@@ -0,0 +1,14 @@
+Framework.algorithm_base
+---------------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.framework.algorithm_base
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/framework_docs/index.rst b/docs/framework_docs/index.rst
new file mode 100644
index 000000000..7323e120c
--- /dev/null
+++ b/docs/framework_docs/index.rst
@@ -0,0 +1,10 @@
+PARL.Framework
+=====================================
+
+.. toctree::
+ :maxdepth: 1
+
+ agent_base
+ algorithm_base
+ model_base
+ policy_distri
diff --git a/docs/framework_docs/model_base.rst b/docs/framework_docs/model_base.rst
new file mode 100644
index 000000000..2a7fb3dfc
--- /dev/null
+++ b/docs/framework_docs/model_base.rst
@@ -0,0 +1,14 @@
+Framework.model_base
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.framework.model_base
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/framework_docs/policy_distri.rst b/docs/framework_docs/policy_distri.rst
new file mode 100644
index 000000000..fb81c1bca
--- /dev/null
+++ b/docs/framework_docs/policy_distri.rst
@@ -0,0 +1,14 @@
+Framework.policy_distribution
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.framework.policy_distribution
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/index.rst b/docs/index.rst
index 1ca199004..d81164731 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -68,11 +68,15 @@ Features
implementations.rst
.. toctree::
- :maxdepth: 1
- :caption: APIs
-
- ./api_docs.utils
- ./api_docs.index
+ :maxdepth: 3
+ :caption: API
+
+ algo_docs/index
+ framework_docs/index
+ layers_docs/index
+ plutils_docs/index
+ remote_docs/index
+ utils_docs/index
Abstractions
----------------
diff --git a/docs/installation.rst b/docs/installation.rst
index fd0710c4b..52e071f04 100644
--- a/docs/installation.rst
+++ b/docs/installation.rst
@@ -9,4 +9,4 @@ Install
-------------
PARL is distributed on PyPI and can be installed with pip:
::
- pip install parl
+ pip install parl
diff --git a/docs/layers_docs/attr_holder.rst b/docs/layers_docs/attr_holder.rst
new file mode 100644
index 000000000..c14c2a790
--- /dev/null
+++ b/docs/layers_docs/attr_holder.rst
@@ -0,0 +1,14 @@
+Layers.attr_docs
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.layers.attr_holder
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/layers_docs/index.rst b/docs/layers_docs/index.rst
new file mode 100644
index 000000000..fe05e73e6
--- /dev/null
+++ b/docs/layers_docs/index.rst
@@ -0,0 +1,9 @@
+PARL.Layers
+=====================================
+
+.. toctree::
+ :maxdepth: 1
+
+ attr_holder
+ layer_wrappers
+
\ No newline at end of file
diff --git a/docs/layers_docs/layer_wrappers.rst b/docs/layers_docs/layer_wrappers.rst
new file mode 100644
index 000000000..da7861554
--- /dev/null
+++ b/docs/layers_docs/layer_wrappers.rst
@@ -0,0 +1,14 @@
+Layers.layer_wrappers
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.layers.layer_wrappers
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/plutils_docs/common.rst b/docs/plutils_docs/common.rst
new file mode 100644
index 000000000..cdd5ab5ad
--- /dev/null
+++ b/docs/plutils_docs/common.rst
@@ -0,0 +1,14 @@
+Plutils.common
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.plutils.common
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/plutils_docs/index.rst b/docs/plutils_docs/index.rst
new file mode 100644
index 000000000..7a4ce74af
--- /dev/null
+++ b/docs/plutils_docs/index.rst
@@ -0,0 +1,8 @@
+PARL.Plutils
+=====================================
+
+.. toctree::
+ :maxdepth: 1
+
+ common
+
\ No newline at end of file
diff --git a/docs/remote_docs/exceptions.rst b/docs/remote_docs/exceptions.rst
new file mode 100644
index 000000000..7654c90df
--- /dev/null
+++ b/docs/remote_docs/exceptions.rst
@@ -0,0 +1,14 @@
+Remote.exception
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.remote.exceptions
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/remote_docs/index.rst b/docs/remote_docs/index.rst
new file mode 100644
index 000000000..c0a58e8a9
--- /dev/null
+++ b/docs/remote_docs/index.rst
@@ -0,0 +1,12 @@
+PARL.Remote
+=====================================
+
+.. toctree::
+ :maxdepth: 1
+
+ exceptions
+ remote_constants
+ remote_decorator
+ remote_manager
+ remote_object
+
\ No newline at end of file
diff --git a/docs/remote_docs/remote_constants.rst b/docs/remote_docs/remote_constants.rst
new file mode 100644
index 000000000..ae1d600b8
--- /dev/null
+++ b/docs/remote_docs/remote_constants.rst
@@ -0,0 +1,14 @@
+Remote.remote_constants
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.remote.remote_constants
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/remote_docs/remote_decorator.rst b/docs/remote_docs/remote_decorator.rst
new file mode 100644
index 000000000..77a1aec48
--- /dev/null
+++ b/docs/remote_docs/remote_decorator.rst
@@ -0,0 +1,14 @@
+Remote.remote_decorator
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.remote.remote_decorator
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/remote_docs/remote_manager.rst b/docs/remote_docs/remote_manager.rst
new file mode 100644
index 000000000..a37d75af5
--- /dev/null
+++ b/docs/remote_docs/remote_manager.rst
@@ -0,0 +1,14 @@
+Remote.remote_manager
+-----------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.remote.remote_manager
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/remote_docs/remote_object.rst b/docs/remote_docs/remote_object.rst
new file mode 100644
index 000000000..c53feac54
--- /dev/null
+++ b/docs/remote_docs/remote_object.rst
@@ -0,0 +1,14 @@
+Remote.remote_object
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.remote.remote_object
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/utils_docs/communication.rst b/docs/utils_docs/communication.rst
new file mode 100644
index 000000000..32a8160ea
--- /dev/null
+++ b/docs/utils_docs/communication.rst
@@ -0,0 +1,14 @@
+Utils.Communication
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.utils.communication
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/utils_docs/csv_logger.rst b/docs/utils_docs/csv_logger.rst
new file mode 100644
index 000000000..f976d880d
--- /dev/null
+++ b/docs/utils_docs/csv_logger.rst
@@ -0,0 +1,14 @@
+Utils.Csv_logger
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.utils.csv_logger
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/utils_docs/exceptions.rst b/docs/utils_docs/exceptions.rst
new file mode 100644
index 000000000..43685107c
--- /dev/null
+++ b/docs/utils_docs/exceptions.rst
@@ -0,0 +1,14 @@
+Utils.Exceptions
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.utils.exceptions
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/utils_docs/index.rst b/docs/utils_docs/index.rst
new file mode 100644
index 000000000..218f83a4d
--- /dev/null
+++ b/docs/utils_docs/index.rst
@@ -0,0 +1,19 @@
+PARL.Utils
+=====================================
+
+.. toctree::
+ :maxdepth: 1
+
+ communication
+ csv_logger
+ exceptions
+ logger
+ machine_info
+ np_utils
+ replay_memory
+ rl_utils
+ scheduler
+ time_stat
+ utils
+ window_stat
+
\ No newline at end of file
diff --git a/docs/utils_docs/logger.rst b/docs/utils_docs/logger.rst
new file mode 100644
index 000000000..625d3c085
--- /dev/null
+++ b/docs/utils_docs/logger.rst
@@ -0,0 +1,14 @@
+Utils.Logger
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.utils.logger
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/utils_docs/machine_info.rst b/docs/utils_docs/machine_info.rst
new file mode 100644
index 000000000..4aaac551c
--- /dev/null
+++ b/docs/utils_docs/machine_info.rst
@@ -0,0 +1,14 @@
+Utils.Machine_info
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.utils.machine_info
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/utils_docs/np_utils.rst b/docs/utils_docs/np_utils.rst
new file mode 100644
index 000000000..507e509a8
--- /dev/null
+++ b/docs/utils_docs/np_utils.rst
@@ -0,0 +1,14 @@
+Utils.np_utils
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.utils.np_utils
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/utils_docs/replay_memory.rst b/docs/utils_docs/replay_memory.rst
new file mode 100644
index 000000000..fda18c89e
--- /dev/null
+++ b/docs/utils_docs/replay_memory.rst
@@ -0,0 +1,14 @@
+Utils.Replay_memory
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.utils.replay_memory
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/utils_docs/rl_utils.rst b/docs/utils_docs/rl_utils.rst
new file mode 100644
index 000000000..4134847b9
--- /dev/null
+++ b/docs/utils_docs/rl_utils.rst
@@ -0,0 +1,14 @@
+Utils.RL_utils
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.utils.rl_utils
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/utils_docs/scheduler.rst b/docs/utils_docs/scheduler.rst
new file mode 100644
index 000000000..c39b31e61
--- /dev/null
+++ b/docs/utils_docs/scheduler.rst
@@ -0,0 +1,14 @@
+Utils.Scheduler
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.utils.scheduler
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/utils_docs/time_stat.rst b/docs/utils_docs/time_stat.rst
new file mode 100644
index 000000000..bcbc0ae7a
--- /dev/null
+++ b/docs/utils_docs/time_stat.rst
@@ -0,0 +1,14 @@
+Utils.Time_stat
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.utils.time_stat
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/utils_docs/utils.rst b/docs/utils_docs/utils.rst
new file mode 100644
index 000000000..a3d96e27f
--- /dev/null
+++ b/docs/utils_docs/utils.rst
@@ -0,0 +1,14 @@
+Utils.Utils
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.utils.utils
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/utils_docs/window_stat.rst b/docs/utils_docs/window_stat.rst
new file mode 100644
index 000000000..37371b182
--- /dev/null
+++ b/docs/utils_docs/window_stat.rst
@@ -0,0 +1,14 @@
+Utils.Window_stat
+--------------------
+
+.. container:: custom-index
+
+ .. raw:: html
+
+
+
+
+.. automodule:: parl.utils.window_stat
+ :members:
+ :undoc-members:
+ :show-inheritance:
From f8d66cff987f42fcafd69dc6450a11b659a9d094 Mon Sep 17 00:00:00 2001
From: LI Yunxiang <1718613239banma@gmail.com>
Date: Mon, 8 Jul 2019 18:11:58 +0800
Subject: [PATCH 2/2] update
---
docs/algo_docs/impala/index.rst | 3 ++-
docs/algo_docs/index.rst | 3 ++-
docs/conf.py | 2 --
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/algo_docs/impala/index.rst b/docs/algo_docs/impala/index.rst
index c16a9e7e7..1a8b2a71c 100644
--- a/docs/algo_docs/impala/index.rst
+++ b/docs/algo_docs/impala/index.rst
@@ -5,4 +5,5 @@ Algorithms.impala
:maxdepth: 1
impala
- vtrace
\ No newline at end of file
+ vtrace
+
\ No newline at end of file
diff --git a/docs/algo_docs/index.rst b/docs/algo_docs/index.rst
index 51817c7c1..8435f47e4 100644
--- a/docs/algo_docs/index.rst
+++ b/docs/algo_docs/index.rst
@@ -9,4 +9,5 @@ PARL.Algorithms
ddpg
dqn
policy_gradient
- ppo
\ No newline at end of file
+ ppo
+
\ No newline at end of file
diff --git a/docs/conf.py b/docs/conf.py
index 489cabc9d..1371d20d9 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -35,8 +35,6 @@
import sys
import parl
autodoc_mock_imports = ['paddle']
-sys.path.insert(0, os.path.abspath('.'))
-sys.path.insert(0, os.path.abspath('..'))
release = parl.__version__
project = 'PARL'
copyright = '2019, nlp-ol@baidu.com'