Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
VisualDL
提交
ec572c0d
V
VisualDL
项目概览
PaddlePaddle
/
VisualDL
大约 2 年 前同步成功
通知
89
Star
4655
Fork
642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
5
Wiki
分析
仓库
DevOps
项目成员
Pages
V
VisualDL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
5
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ec572c0d
编写于
1月 16, 2018
作者:
D
daminglu
提交者:
GitHub
1月 16, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Translate quick start (#158)
* working on quick start * quick start english
上级
0431d40d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
100 addition
and
0 deletion
+100
-0
docs/quick_start_en.md
docs/quick_start_en.md
+100
-0
未找到文件。
docs/quick_start_en.md
0 → 100644
浏览文件 @
ec572c0d
# Quick start
VisualDL is a deep learning visualization tool. It can be used to visualize intermediate and final results for training.
Currently, VisualDL supports visualization features as follows:
-
Scalar: plot of trends, can be used to show error trends during training.
-
Image: image visualization, can be used to show intermediate images from CNN.
-
Histogram: can be used to show parameter distribution and trend.
-
Graph: can be used to visualize model structure.
VisualDL provides both Python SDK and C++ SDK in nature. It can support various frameworks.
Users can retrieve visualization data by simply adding a few lines of code using Pythong SDK.
In addition, users can also have a deep integration by using the C++ SDK at a lower level.
## A Simple Python Demo on Scalar
For simplicity, we first try to use Python SDK.
The first step of using VisualDL is to create a
`LogWriter' that can store visualization data.
```python
from VisualDL import LogWriter
from random import random
logw = LogWriter("./random_log", sync_cycle=30)
```
The first parameter points to a folder; the second parameter `
sync_cycle
` specifies out of how memory operations should be
store the data into hard drive.
There are different modes for model training, such as training, validating and testing. All these correspond to `
mode' in VisualDL.
We can use the following pattern to specify mode:
```
python
with
logw
.
mode
(
"train"
)
as
logger
:
pass
```
Next we create a
`Scalar`
component. Each component needs a tag. A tag can be a string of any length.
For example,
`layer/classification/error`
.
```
# create scalars in mode train and test.
with logw.mode('train') as logger:
scalar0 = logger.scalar("scratch/scalar")
with logw.mode('test') as logger:
scalar1 = logger.scalar("scratch/scalar")
# add scalar records.
for step in range(200):
scalar0.add_record(step, step * 1. / 200)
scalar1.add_record(step, 1. - step * 1. / 200)
```
The example above randomly generated some logs. Next we can open the board page:
```
visualDL --logdir ./random_log --port 8080
```
Point your browser to
`http://0.0.0.0:8080`
, you can see the scalar as follows:
<p
align=
"center"
>
<img
src=
"./images/scratch_scalar.png"
/>
</p>
## Scalar Demo in C++
VisualDL's C++ SDK is very similar to its Python SDK. The Python demo above can be writen in C++ as follows:
```
c++
const
auto
dir
=
"./randomlog"
;
LogWriter
logwriter
(
dir
,
30
);
auto
logger
=
logwriter
.
AsMode
(
"train"
);
components
::
Scalar
<
float
>
scalar0
(
writer
.
AddTablet
(
"scalar0"
));
components
::
Scalar
<
float
>
scalar1
(
writer
.
AddTablet
(
"scalar1"
));
for
(
int
step
=
0
;
step
<
200
;
step
++
)
{
scalar0
.
AddRecord
(
step
,
step
*
1.
/
200
);
scalar1
.
AddRecord
(
step
,
1.
-
step
*
1.
/
200
);
}
```
## Visualization Based on ONNX Model Structure
VisualDL supports the visualization for the format in
[
ONNX
](
https://github.com/onnx/onnx
)
.
Currently, ONNX supports format conversion among various deep learning frameworks such as
`MXNet`
,
`PyTorch`
,
`Caffe2`
,
`Caffe`
.
```
visualDL --logdir somedir --model_pb <path_to_model>
```
For example, for the MNIST dataset, Graph component can render model graph as below:
<p
align=
center
>
<img
width=
"70%"
src=
"https://github.com/PaddlePaddle/VisualDL/blob/develop/demo/mxnet/mxnet_graph.gif"
/>
</p>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录