未验证 提交 dce2a570 编写于 作者: L LI Yunxiang 提交者: GitHub

add tensorboard doc (#263)

上级 9e782d03
......@@ -58,9 +58,10 @@ Abstractions
:maxdepth: 1
:caption: Tutorial
getting_started.rst
new_alg.rst
save_param.rst
tutorial/getting_started.rst
tutorial/new_alg.rst
tutorial/save_param.rst
tutorial/tensorboard.rst
.. toctree::
:maxdepth: 2
......
Tensorboard
===============
Visualize the results with tensorboard.
add_scalar
-------------
Common used arguments:
* tensorboard.add_scalar(tag, scalar_value, global_step=None)
* tag *(string)* – Data identifier
* scalar_value *(float or string/blobname)* – Value to save
* global_step *(int)* – Global step value to record
Example:
.. code-block:: python
from parl.utils import tensorboard
x = range(100)
for i in x:
tensorboard.add_scalar('y=2x', i * 2, i)
Expected result:
.. image:: add_scalar.jpg
:scale: 50 %
add_histogram
----------------
Common used arguments:
* tensorboard.add_scalar(tag, scalar_value, global_step=None)
* tag *(string)* – Data identifier
* values *(torch.Tensor, numpy.array, or string/blobname)* – Values to build histogram
* global_step *(int)* – Global step value to record
Example:
.. code-block:: python
from parl.utils import tensorboard
import numpy as np
for i in range(10):
x = np.random.random(1000)
tensorboard.add_histogram('distribution centers', x + i, i)
Expected result:
.. image:: add_histogram.jpg
:scale: 50 %
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册