未验证 提交 1ff7981e 编写于 作者: P Peter Pan 提交者: GitHub

docs: update documentation (#857)

上级 51776d26
......@@ -6,6 +6,8 @@ This is the Changelog for the VisualDL 2.0 project.
## v2.0.5 - 2020-11-24
**ZH**
- 问题修复
- **FE**: 修复histogram页面图表坐标轴名称会重复渲染的问题 (#824)
- **FE**: 修复图表提示窗中表格内容过长的问题 (#829)
......
......@@ -19,7 +19,14 @@
## Introduction
VisualDL, a visualization analysis tool of PaddlePaddle, provides a variety of charts to show the trends of parameters, and visualizes model structures, data samples, histograms of tensors, pr curves and high-dimensional data distributions. It enables users to understand the training process and the model structure more clearly and intuitively so as to optimize models efficiently.
VisualDL provides various visualization functions, including tracking metrics in real-time, visualizing the model structure, displaying the data sample, presenting the changes of distributions of tensors, showing the pr curves, projecting high-dimensional data to a lower dimensional space and more. Additionally, VisualDL provides VDL.service, which enables developers easily to save, track and share visualization results of experiments. For specific guidelines of each function, please refer to [**VisualDL User Guide**](./docs/components/UserGuide-en.md). Currently, VisualDL iterates rapidly and new functions will be continously added.
VisualDL provides various visualization functions, including tracking metrics in real-time, visualizing the model structure, displaying the data sample, presenting the changes of distributions of tensors, showing the pr curves, projecting high-dimensional data to a lower dimensional space and more. Additionally, VisualDL provides VDL.service, which enables developers easily to save, track and share visualization results of experiments. For specific guidelines of each function, please refer to [**VisualDL User Guide**](./docs/components/UserGuide-en.md). Currently, VisualDL iterates rapidly and new functions will be continuously added.
Browsers supported by VisualDL are:
- Google Chrome ≥ 79
- Firefox ≥ 67
- Microsoft Edge ≥ 79
- Safari ≥ 11.1
VisualDL natively supports the use of Python. Developers can retrieve plentiful visualization results by simply adding a few lines of Python code into the model before training.
......@@ -95,14 +102,14 @@ class LogWriter(logdir=None,
#### Interface Parameters
| parameters | type | meaning |
| --------------- | ------- | ------------------------------------------------------------ |
| --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| logdir | string | The path location of log file. VisualDL will create a log file under this path to record information generated by the training process. If not specified, the path will be `runs/${CURRENT_TIME}`as default. |
| comment | string | Add a suffix to the log folder name, which is invalid if logdir is already specified. |
| max_queue | int | The maximum capacity of the data generated before recording in a log file. If the capacity is reached, the data is immediately written into the log file. |
| flush_secs | int | The maximum cache time of the data generated before recording in a log file, when this time is reached, the data is immediately written to the log file. |
| filename_suffix | string | Add a suffix to the default log file name. |
| write_to_disk | boolean | Write into disk or not. |
| display_name | string | Set the name of different runs when `logdir` is too long or needed to be hidden. If not set, the default name is `logdir`.|
| display_name | string | Set the name of different runs when `logdir` is too long or needed to be hidden. If not set, the default name is `logdir`. |
#### Example
......@@ -121,23 +128,24 @@ with LogWriter(logdir="./log/scalar_test/train") as writer:
### 2. Launch Panel
In the above example, the log has recorded three sets of scalar values. Develpers can view the visualization results of the log file through launching the visualDL panel. There are two ways to launch a log file:
In the above example, the log has recorded three sets of scalar values. Developers can view the visualization results of the log file through launching the visualDL panel. There are two ways to launch a log file:
#### Launch by Command Line
Use the command line to launch the VisualDL panel:
```python
visualdl --logdir <dir_1, dir_2, ... , dir_n> --host <host> --port <port> --cache-timeout <cache_timeout> --language <language> --public-path <public_path> --api-only
visualdl --logdir <dir_1, dir_2, ... , dir_n> --model <model_file> --host <host> --port <port> --cache-timeout <cache_timeout> --language <language> --public-path <public_path> --api-only
```
Parameter details:
| parameters | meaning |
| --------------- | ------------------------------------------------------------ |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| --logdir | Set one or more directories of the log. VisualDL will search the log file recursively under this path to display the all experimental results. |
| --host | Specify IP address. The default value is·`127.0.0.1`. |
| --port | Set the port. The default value is`8040`. |
| --model | Set path to the model file (not a directory). VisualDL will visualize the model file in Graph page. PaddlePaddle、ONNX、Keras、Core ML、Caffe and Other model formats are supported. Please refer to [Graph - Functional Instructions](./docs/components/UserGuide-en.md#functional-instructions-2). |
| --host | Specify IP address. The default value is `127.0.0.1`. |
| --port | Set the port. The default value is `8040`. |
| --cache-timeout | Cache time of the backend. During the cache time, the front end requests the same URL multiple times, and then the returned data is obtained from the cache. The default cache time is 20 seconds. |
| --language | The language of the VisualDL panel. Language can be specified as 'en' or 'zh', and the default is the language used by the browser. |
| --public-path | The URL path of the VisualDL panel. The default path is '/app', meaning that the access address is 'http://&lt;host&gt;:&lt;port&gt;/app'. |
......@@ -156,6 +164,7 @@ Developers can start the VisualDL panel in Python script as follows:
```python
visualdl.server.app.run(logdir,
model="path/to/model",
host="127.0.0.1",
port=8080,
cache_timeout=20,
......@@ -170,15 +179,16 @@ Please note: since all parameters are indefinite except `logdir`, developers sho
The interface parameters are as follows:
| parameters | type | meaning |
| ------------- | -------------------------------------------------- | ------------------------------------------------------------ |
| ------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| logdir | string or list[string_1, string_2, ... , string_n] | Set one or more directories of the log. VisualDL will search the log file recursively under this path to display the all experimental results. |
| host | string | Specify IP address. The default value is·`127.0.0.1`. |
| port | int | Set the port. The default value is`8040`. |
| model | string | Set path to the model file (not a directory). VisualDL will visualize the model file in Graph page. |
| host | string | Specify IP address. The default value is `127.0.0.1`. |
| port | int | Set the port. The default value is `8040`. |
| cache_timeout | int | Cache time of the backend. During the cache time, the front end requests the same URL multiple times, and then the returned data is obtained from the cache. The default cache time is 20 seconds. |
| language | string | The language of the VisualDL panel. Language can be specified as 'en' or 'zh', and the default is the language used by the browser. |
| public_path | string | The URL path of the VisualDL panel. The default path is '/app', meaning that the access address is 'http://&lt;host&gt;:&lt;port&gt;/app'. |
| api_only | boolean | Decide whether or not to provide only API. If this parameter is set, VisualDL will only provides API service without displaying the web page, and the API address is 'http://&lt;host&gt;:&lt;port&gt;/&lt;public_path&gt;/api'. Additionally, If the parameter public_path is not specified, the default address is 'http://&lt;host&gt;:&lt;port&gt;/api'. |
| open_browser | boolean | Whether or not to open the browser. If this parameter is set as True, the browser will be openned automatically and VisualDL panel will be launched at the same time. If parameter api_only is specified as True, parameter open_browser can be ignored. |
| open_browser | boolean | Whether or not to open the browser. If this parameter is set as True, the browser will be opened automatically and VisualDL panel will be launched at the same time. If parameter api_only is specified as True, parameter open_browser can be ignored. |
To visualize the log file generated in the previous step, developers can launch the panel through the command:
......@@ -194,7 +204,45 @@ After launching the panel by one of the above methods, developers can see the vi
<img src="https://user-images.githubusercontent.com/48054808/90868674-ba321f00-e3c9-11ea-83c1-f03c6dd19187.png" width="70%"/>
</p>
### 3. Read data in log files using LogReader
VisualDL also provide `LogReader` interface to read raw data from log files.
```python
class LogReader(logdir=None,
file_name='')
```
#### interface parameters
| parameters | type | meaning |
| ---------- | ------ | ------------------------------------ |
| logdir | string | Path to the log directory. Required. |
| file_name | string | File name of the log file. Required. |
#### Example
Suppose there is a log file named `vdlrecords.1605533348.log` in directory `./log`. We can get scalar data in `loss` tag by
```python
from visualdl import LogReader
reader = LogReader(logdir='./log', file_name='vdlrecords.1605533348.log')
data = reader.get_data('scalar', 'loss')
print(data)
```
The result is a list of
```python
...
id: 5
tag: "Metrics/Training(Step): loss"
timestamp: 1605533356039
value: 3.1297709941864014
...
```
For more information of `LogReader`, please refer to [LogReader](./docs/io/LogReader.md).
## Function Preview
......@@ -203,7 +251,7 @@ After launching the panel by one of the above methods, developers can see the vi
#### Dynamic Display
After the launchment of VisualDL Board, the LogReader will continuously record the data to display in the front-end. Hence, the changes of parameters can be visualized in real-time, as shown below:
After the launch of VisualDL Board, the LogReader will continuously record the data to display in the front-end. Hence, the changes of parameters can be visualized in real-time, as shown below:
<p align="center">
<img src="https://visualdl.bj.bcebos.com/images/dynamic_display.gif" width="60%"/>
......@@ -271,17 +319,18 @@ Histogram displays how the trend of tensors (weight, bias, gradient, etc.) chang
**VDL.service** enables developers to easily save, track and share visualization results with anyone for free.
<p align="center">
<img src=https://user-images.githubusercontent.com/48054808/93731055-fbeafb00-fbfd-11ea-80f4-bbfd08a0fc35.png
<img src=https://user-images.githubusercontent.com/48054808/93731055-fbeafb00-fbfd-11ea-80f4-bbfd08a0fc35.png width="85%"/>
</p>
## Contribution
VisualDL, in which Graph is powered by [Netron](https://github.com/lutzroeder/netron), is an open source project supported by [PaddlePaddle](https://www.paddlepaddle.org/) and [ECharts](https://echarts.apache.org/) . Developers are warmly welcomed to use, comment and contribute.
VisualDL, in which Graph is powered by [Netron](https://github.com/lutzroeder/netron), is an open source project supported by [PaddlePaddle](https://www.paddlepaddle.org/) and [ECharts](https://echarts.apache.org/).
Developers are warmly welcomed to use, comment and contribute.
## More Details
For more details related to the use of VisualDL, please refer to [**VisualDL User Guide**](./docs/components/README.md)
For more details related to the use of VisualDL, please refer to [**VisualDL User Guide**](./docs/components/UserGuide-en.md)
## Technical Communication
......
......@@ -22,9 +22,14 @@ VisualDL是飞桨可视化分析工具,以丰富的图表呈现训练参数变
VisualDL提供丰富的可视化功能,支持标量、图结构、数据样本可视化、直方图、PR曲线及高维数据降维呈现等诸多功能,同时VisualDL提供可视化结果保存服务,通过VDL.service生成链接,保存并分享可视化结果。具体功能使用方式,请参见 [**VisualDL使用指南**](./docs/components/README.md)。项目正处于高速迭代中,敬请期待新组件的加入。
VisualDL支持浏览器种类:Chrome(81和83)、Safari 13、FireFox(77和78)、Edge(Chromium版)。
VisualDL支持浏览器
VisualDL原生支持python的使用, 通过在模型的Python配置中添加几行代码,便可为训练过程提供丰富的可视化支持。
- Google Chrome ≥ 79
- Firefox ≥ 67
- Microsoft Edge ≥ 79
- Safari ≥ 11.1
VisualDL原生支持Python的使用, 通过在模型的Python配置中添加几行代码,便可为训练过程提供丰富的可视化支持。
## 目录
......@@ -103,7 +108,7 @@ class LogWriter(logdir=None,
#### 接口参数
| 参数 | 格式 | 含义 |
| --------------- | ------- | ------------------------------------------------------------ |
| --------------- | ------- | ------------------------------------------------------------------------------------------------------ |
| logdir | string | 日志文件所在的路径,VisualDL将在此路径下建立日志文件并进行记录,如果不填则默认为`runs/${CURRENT_TIME}` |
| comment | string | 为日志文件夹名添加后缀,如果制定了logdir则此项无效 |
| max_queue | int | 日志记录消息队列的最大容量,达到此容量则立即写入到日志文件 |
......@@ -137,13 +142,13 @@ with LogWriter(logdir="./log/scalar_test/train") as writer:
使用命令行启动VisualDL面板,命令格式如下:
```python
visualdl --logdir <dir_1, dir_2, ... , dir_n> --host <host> --port <port> --cache-timeout <cache_timeout> --language <language> --public-path <public_path> --api-only
visualdl --logdir <dir_1, dir_2, ... , dir_n> --model <model_file> --host <host> --port <port> --cache-timeout <cache_timeout> --language <language> --public-path <public_path> --api-only
```
参数详情:
| 参数 | 意义 |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| --logdir | 设定日志所在目录,可以指定多个目录,VisualDL将遍历并且迭代寻找指定目录的子目录,将所有实验结果进行可视化 |
| --model | 设定模型文件路径(非文件夹路径),VisualDL将在此路径指定的模型文件进行可视化,目前可支持PaddlePaddle、ONNX、Keras、Core ML、Caffe等多种模型结构,详情可查看[graph支持模型种类](./docs/components/README.md#%E5%8A%9F%E8%83%BD%E6%93%8D%E4%BD%9C%E8%AF%B4%E6%98%8E-2) |
| --host | 设定IP,默认为`127.0.0.1` |
......@@ -165,6 +170,7 @@ visualdl --logdir ./log
```python
visualdl.server.app.run(logdir,
model="path/to/model",
host="127.0.0.1",
port=8080,
cache_timeout=20,
......@@ -179,7 +185,7 @@ visualdl.server.app.run(logdir,
接口参数具体如下:
| 参数 | 格式 | 含义 |
| ------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| logdir | string或list[string_1, string_2, ... , string_n] | 日志文件所在的路径,VisualDL将在此路径下递归搜索日志文件并进行可视化,可指定单个或多个路径 |
| model | string | 模型文件路径(非文件夹路径),VisualDL将在此路径指定的模型文件进行可视化 |
| host | string | 指定启动服务的ip,默认为`127.0.0.1` |
......@@ -207,6 +213,7 @@ app.run(logdir="./log")
### 3. 使用LogReader获取日志中的数据
VisualDL的后端也提供了获取日志数据的组件`LogReader`,可通过其获取日志中任意数据,接口如下:
```python
class LogReader(logdir=None,
file_name='')
......@@ -214,9 +221,9 @@ class LogReader(logdir=None,
#### 接口参数
| 参数 | 格式 | 含义 |
| --------------- | ------- | ------------------------------------------------------------ |
| logdir | string | 日志文件所在的路径,必填|
| file_name | string | 指定要读的日志文件名,必填|
| --------- | ------ | -------------------------- |
| logdir | string | 日志文件所在的路径,必填 |
| file_name | string | 指定要读的日志文件名,必填 |
#### 示例
......@@ -229,7 +236,9 @@ reader = LogReader(logdir='./log', file_name='vdlrecords.1605533348.log')
data = reader.get_data('scalar', 'loss')
print(data)
```
结果为列表形式,如下
```python
...
id: 5
......@@ -239,9 +248,7 @@ value: 3.1297709941864014
...
```
关于LogReader的更多具体用法,可参考[LogReader](./docs/io/LogReader.md)
关于LogReader的更多具体用法,可参考[LogReader](./docs/io/LogReader.md)
## 可视化功能概览
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册