-
Notifications
You must be signed in to change notification settings - Fork 629
doc/init Chinese doc #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f8a9894
4acca85
4f95c61
6ac741b
03073c5
a2b81e2
3c4429c
ad1b19e
3c2c189
6ffdf7f
b8224f7
111c7a1
ae11276
9811ea4
27361f5
6f7a7cf
74f0f87
5c408b6
92233bf
092a8a4
da3091b
972f744
fb08734
a81d517
4594831
ac60be3
e353bae
3f57cd0
35fcbbc
9ec3d95
415eb03
195c923
419de59
839f750
3a4fcf9
7c5bc86
b15010e
0015673
64b0f37
c27317d
d4fa9e6
55a35e6
a8ae5ad
9b1e6fe
5e66cde
1bef101
b7f95aa
a432cd5
baf4d1b
8bf1415
ebac7b1
2fc9148
7ff1db0
2559b77
15f9745
9a2d5d8
d01aec1
692b2e7
932a95a
cf1ebdf
26ff641
4ce5ab0
0ef22aa
88a96cc
3ea9c8d
a85e9c4
1f67fe6
244bae1
4e97c43
36d1a95
70c808c
f1be2fa
a5f76a3
8528d21
8ee5a04
0127fec
2a29fa0
3dcf637
24db427
9ec5555
0638d68
67b4346
872bfbb
c76c3f5
ae80e0c
3a24645
142431b
11e0487
beb1e3b
bc44bd6
702b844
7f37525
dacc87a
c103645
6488503
d87bff4
befaf66
5895b7e
66a17d7
c65bf61
b05a8dd
e14e51b
b0d0f50
7c56767
7d693fb
157ba6e
06c20be
eae9e53
98244c1
353e102
eb6d0cc
b054af6
99b4e5c
9e1411e
43c09c8
2f7f01c
703f9a6
cc100df
3d2d3e3
95912b6
6dac00e
42158f1
bbb6e6c
994ea98
8214750
c3ce0b9
caf9753
616e982
4b1f28c
4b5961c
bfcb081
620eccb
749925c
8757f75
1fccdc8
5b94965
6019cbc
92d16dc
7771aab
0256c98
7259012
f7d6905
198ba05
db2cedc
fe0151b
9a7b4a8
2e897bc
5082f9c
c4c295b
99e169f
fc53517
05e558f
5c37deb
5f71e3c
916f2da
545e1b0
5ebcc90
00ec2f4
30e15a6
b3f55dc
ab99d3c
ba2a960
2af8ff6
1345693
028982e
7bb1158
326321c
f0b3e90
a76ee61
eb1899c
3db9571
b079592
ca02f18
d3129c0
34424cb
03208ff
bdcced5
539454b
2afcad5
5c1dc6c
b58660a
bcf2051
33d6178
0c9c94c
548cc32
8bd00f2
b5aabaf
409b680
3b8c6f7
643f725
71f7104
1bf33ca
1a0d6db
9fd4188
3c02b8d
daaba24
678d583
63ba1cf
00e2bee
f39a861
eae1eaa
2853c51
d4f8e82
76ea4fb
b3746dd
a81238b
96b61e2
e001193
a1bd77d
239d3df
621191d
b1154c7
0fbcfee
8196f47
5368829
dad3335
8b63b7f
fce3752
ce97a50
f901745
7a93e6f
7b0736f
521f595
1fb245c
7ba15a3
26e2b64
eda6e59
8d25355
313e286
36bf528
000c3e1
9444f05
90e2a6a
345b137
514629c
b721119
f01c3a8
af54766
e79ecda
f1db2a5
8199529
0093d6a
d3ad944
a1770c5
494df61
2c4ce7b
241d1a5
2d78e48
d935ee1
45c1656
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,3 +106,7 @@ ENV/ | |
node_modules | ||
/.vscode | ||
package-lock.json | ||
|
||
# PyCharm IDE | ||
.idea/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ cache: | |
- pip | ||
- ccache | ||
- yarn | ||
- npm | ||
sudo: required | ||
dist: trusty | ||
os: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,14 @@ | ||
# VisualDL | ||
|
||
|
||
### How to use | ||
#### Step 1: build frontend | ||
```shell | ||
cd frontend | ||
npm install | ||
npm run build | ||
### How to install | ||
``` | ||
|
||
this step will generate a dist directory under frontend | ||
|
||
### Step 2: copy frontend/dist to server/visualdl/frontend/dist | ||
```shell | ||
mkdir -p server/visualdl/frontend/dist | ||
cp -r frontend/dist server/visualdl/frontend/dist | ||
``` | ||
|
||
#### Step 3: build and install Python package | ||
```shell | ||
cd server/ | ||
sh build.sh | ||
cd dist | ||
sudo pip install --upgrade visualdl-0.0.1-py2-none-any.whl | ||
python setup.py bdist_wheel | ||
pip install --upgrade dist/visualdl-0.0.1-py2-none-any.whl | ||
``` | ||
|
||
|
||
### Step 3: run | ||
``` | ||
# cd to visualdl install dir | ||
cd /usr/local/lib/python2.7/site-packages/visualdl/ | ||
python visual_dl.py --port=8888 | ||
visualDL --logdir=<some log> --port=8888 | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.0.1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
TOP_DIR=$(pwd) | ||
FRONTEND_DIR=$TOP_DIR/frontend | ||
BACKEND_DIR=$TOP_DIR/visualdl | ||
BUILD_DIR=$TOP_DIR/build | ||
|
||
mkdir -p $BUILD_DIR | ||
|
||
build_frontend() { | ||
cd $FRONTEND_DIR | ||
if [ ! -d "dist" ]; then | ||
npm install | ||
npm run build | ||
fi | ||
} | ||
|
||
build_frontend_fake() { | ||
cd $FRONTEND_DIR | ||
mkdir -p dist | ||
} | ||
|
||
build_backend() { | ||
cd $BUILD_DIR | ||
cmake .. | ||
make -j2 | ||
} | ||
|
||
build_onnx_graph() { | ||
# TODO(ChunweiYan) check protoc version here | ||
cd $TOP_DIR/visualdl/server/onnx | ||
protoc onnx.proto --python_out . | ||
} | ||
|
||
package() { | ||
cp -rf $FRONTEND_DIR/dist $TOP_DIR/visualdl/server/ | ||
cp $BUILD_DIR/visualdl/logic/core.so $TOP_DIR/visualdl | ||
cp $BUILD_DIR/visualdl/logic/core.so $TOP_DIR/visualdl/python/ | ||
} | ||
|
||
ARG=$1 | ||
echo "ARG: " $ARG | ||
|
||
|
||
if [ $ARG = "travis-CI" ]; then | ||
build_frontend_fake | ||
else | ||
build_frontend | ||
fi | ||
|
||
build_backend | ||
build_onnx_graph | ||
package |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# VisualDL (Visualize the Deep Learning) | ||
|
||
## 介绍 | ||
VisualDL是一个面向深度学习任务设计的可视化工具,包含了scalar、参数分布、模型结构、图像可视化等功能,项目正处于高速迭代中,新的优化组件会不断加入。 | ||
|
||
目前大多数DNN平台均使用Python作为配置语言,VisualDL原生支持python的使用, | ||
通过在模型配置中添加几行配置,便可以为冷冰冰的训练过程提供丰富的可视化支持。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "冷冰冰" 这种词是不是不太好? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. python => Python |
||
|
||
除了Python SDK之外,VisualDL底层采用C++编写,其暴露的C++ SDK也可以深入其他的平台中, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
实现原生的性能和定制效果。 | ||
|
||
## 组件 | ||
VisualDL 目前支持4种组件: | ||
|
||
- graph | ||
- scalar | ||
- image | ||
- histogram | ||
|
||
### graph | ||
兼容 ONNX(Open Neural Network Exchange)[https://github.com/onnx/onnx], 通过与 python SDK的结合,VisualDL可以兼容包括 PaddlePaddle, pytorch, mxnet在内的大部分主流DNN平台。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. python => Python |
||
|
||
<p align="center"> | ||
<img src="./images/introduction_graph.png"/> | ||
</p> | ||
|
||
### scalar | ||
可以用于展示训练测试的误差趋势 | ||
|
||
<p align="center"> | ||
<img src="./images/introduction_scalar.png"/> | ||
</p> | ||
|
||
### image | ||
可以用于可视化任何tensor,或模型生成的图片 | ||
|
||
<p align="center"> | ||
<img src="./images/introduction_image.png"/> | ||
</p> | ||
|
||
### histogram | ||
|
||
用于可视化任何tensor中元素分布的变化趋势 | ||
|
||
<p align="center"> | ||
<img src="./images/introduction_histogram.png"/> | ||
</p> | ||
|
||
## SDK | ||
VisualDL 同时提供了python SDK 和 C++ SDK 来实现不同方式的使用。 | ||
### Python SDK | ||
以最简单的Scalar组件为例,尝试创建一个scalar组件并插入多个时间步的数据: | ||
|
||
```python | ||
import random | ||
from visualdl import LogWriter | ||
|
||
logdir = "./tmp" | ||
logger = LogWriter(dir, sync_cycle=10) | ||
|
||
# mark the components with 'train' label. | ||
with logger.mode("train"): | ||
# create a scalar component called 'scalars/scalar0' | ||
scalar0 = logger.scalar("scalars/scalar0") | ||
|
||
|
||
# add some records during DL model running, lets start from another block. | ||
with logger.mode("train"): | ||
# add scalars | ||
for step in range(100): | ||
scalar0.add_record(step, random.random()) | ||
``` | ||
|
||
### C++ SDK | ||
上面 Python SDK 中代码完全一致的C++ SDK用法如下 | ||
```c++ | ||
#include <cstdlib> | ||
#include <string> | ||
#include "visualdl/sdk.h" | ||
|
||
namespace vs = visualdl; | ||
namepsace cp = visualdl::components; | ||
|
||
int main() { | ||
const std::string dir = "./tmp"; | ||
vs::LogWriter logger(dir, 10); | ||
|
||
logger.SetMode("train"); | ||
auto tablet = logger.NewTablet("scalars/scalar0"); | ||
|
||
cp::Scalar<float> scalar0(tablet); | ||
|
||
for (int step = 0; step < 1000; step++) { | ||
float v = (float)std::rand() / RAND_MAX; | ||
scalar0.AddRecord(step, v); | ||
} | ||
|
||
return 0; | ||
} | ||
``` | ||
## 启动Board | ||
当训练过程中已经产生了日志数据,就可以启动board进行实时预览可视化信息 | ||
|
||
``` | ||
visualDL --logdir <some log dir> | ||
``` | ||
|
||
board 还支持一下参数来实现远程的访问: | ||
|
||
- `--host` 设定IP | ||
- `--port` 设定端口 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
/** | ||
* get mock data | ||
* | ||
* @param {string} path request path | ||
* @param {Object} queryParam query params | ||
* @param {Object} postParam post params | ||
* @return {Object} | ||
*/ | ||
module.exports = function (path, queryParam, postParam) { | ||
return { | ||
// moock delay | ||
_timeout: 0, | ||
// mock http status | ||
_status: 200, | ||
// mock response data | ||
_data: { | ||
status: 0, | ||
msg: 'SUCCESS', | ||
data: { | ||
title: { | ||
text: 'Graph 简单示例' | ||
}, | ||
tooltip: {}, | ||
animationDurationUpdate: 1500, | ||
animationEasingUpdate: 'quinticInOut', | ||
series : [ | ||
{ | ||
type: 'graph', | ||
layout: 'none', | ||
symbolSize: 50, | ||
roam: true, | ||
label: { | ||
normal: { | ||
show: true | ||
} | ||
}, | ||
edgeSymbol: ['circle', 'arrow'], | ||
edgeSymbolSize: [4, 10], | ||
edgeLabel: { | ||
normal: { | ||
textStyle: { | ||
fontSize: 20 | ||
} | ||
} | ||
}, | ||
data: [{ | ||
name: '节点1', | ||
x: 300, | ||
y: 300 | ||
}, { | ||
name: '节点2', | ||
x: 800, | ||
y: 300 | ||
}, { | ||
name: '节点3', | ||
x: 550, | ||
y: 100 | ||
}, { | ||
name: '节点4', | ||
x: 550, | ||
y: 500 | ||
}], | ||
// links: [], | ||
links: [{ | ||
source: 0, | ||
target: 1, | ||
symbolSize: [5, 20], | ||
label: { | ||
normal: { | ||
show: true | ||
} | ||
}, | ||
lineStyle: { | ||
normal: { | ||
width: 5, | ||
curveness: 0.2 | ||
} | ||
} | ||
}, { | ||
source: '节点2', | ||
target: '节点1', | ||
label: { | ||
normal: { | ||
show: true | ||
} | ||
}, | ||
lineStyle: { | ||
normal: { curveness: 0.2 } | ||
} | ||
}, { | ||
source: '节点1', | ||
target: '节点3' | ||
}, { | ||
source: '节点2', | ||
target: '节点3' | ||
}, { | ||
source: '节点2', | ||
target: '节点4' | ||
}, { | ||
source: '节点1', | ||
target: '节点4' | ||
}], | ||
lineStyle: { | ||
normal: { | ||
opacity: 0.9, | ||
width: 2, | ||
curveness: 0 | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'scalar' 需不需要翻译?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"优化组件" => "组件"