Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
VisualDL
提交
971578c6
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看板
未验证
提交
971578c6
编写于
1月 14, 2018
作者:
Y
Yan Chunwei
提交者:
GitHub
1月 14, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enhance/add histogram sample (#137)
上级
346b64e1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
2 deletion
+17
-2
visualdl/server/lib.py
visualdl/server/lib.py
+17
-2
未找到文件。
visualdl/server/lib.py
浏览文件 @
971578c6
...
@@ -146,7 +146,7 @@ def get_histogram_tags(storage):
...
@@ -146,7 +146,7 @@ def get_histogram_tags(storage):
return
get_tags
(
storage
,
'histogram'
)
return
get_tags
(
storage
,
'histogram'
)
def
get_histogram
(
storage
,
mode
,
tag
):
def
get_histogram
(
storage
,
mode
,
tag
,
num_samples
=
200
):
with
storage
.
mode
(
mode
)
as
reader
:
with
storage
.
mode
(
mode
)
as
reader
:
histogram
=
reader
.
histogram
(
tag
)
histogram
=
reader
.
histogram
(
tag
)
res
=
[]
res
=
[]
...
@@ -171,7 +171,22 @@ def get_histogram(storage, mode, tag):
...
@@ -171,7 +171,22 @@ def get_histogram(storage, mode, tag):
[
instance
.
left
(),
[
instance
.
left
(),
instance
.
right
(),
instance
.
right
(),
instance
.
frequency
()])
instance
.
frequency
()])
return
res
if
len
(
res
)
<
num_samples
:
return
res
# sample some steps
span
=
float
(
len
(
res
))
/
(
num_samples
-
1
)
span_offset
=
0
data_idx
=
0
sampled_data
=
[]
data_size
=
len
(
res
)
while
data_idx
<
data_size
:
sampled_data
.
append
(
res
[
data_size
-
data_idx
-
1
])
span_offset
+=
1
data_idx
=
int
(
span_offset
*
span
)
sampled_data
.
append
(
res
[
0
])
return
sampled_data
[::
-
1
]
def
retry
(
ntimes
,
function
,
time2sleep
,
*
args
,
**
kwargs
):
def
retry
(
ntimes
,
function
,
time2sleep
,
*
args
,
**
kwargs
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录