Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
VisualDL
提交
fbb72b74
V
VisualDL
项目概览
PaddlePaddle
/
VisualDL
1 年多 前同步成功
通知
88
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看板
未验证
提交
fbb72b74
编写于
6月 21, 2022
作者:
C
chenjian
提交者:
GitHub
6月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix hparams demo error (#1067)
上级
d21de499
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
4 addition
and
4 deletion
+4
-4
demo/components/hparam_test.py
demo/components/hparam_test.py
+4
-4
未找到文件。
demo/components/hparam_test.py
浏览文件 @
fbb72b74
...
...
@@ -21,8 +21,8 @@ if __name__ == '__main__':
# 记录第一次实验数据
with
LogWriter
(
'./log/hparams_test/train/run1'
)
as
writer
:
# 记录hparams数值和metrics名称
writer
.
add_hparams
(
hparam_dict
=
{
'lr'
:
0.1
,
'bsize'
:
1
,
'opt'
:
'sgd'
},
metric_list
=
[
'hparam/accuracy'
,
'hparam/loss'
])
writer
.
add_hparams
(
hparam
s
_dict
=
{
'lr'
:
0.1
,
'bsize'
:
1
,
'opt'
:
'sgd'
},
metric
s
_list
=
[
'hparam/accuracy'
,
'hparam/loss'
])
# 通过将add_scalar接口中的tag与metrics名称对应,记录一次实验中不同step的metrics数值
for
i
in
range
(
10
):
writer
.
add_scalar
(
tag
=
'hparam/accuracy'
,
value
=
i
,
step
=
i
)
...
...
@@ -31,8 +31,8 @@ if __name__ == '__main__':
# 记录第二次实验数据
with
LogWriter
(
'./log/hparams_test/train/run2'
)
as
writer
:
# 记录hparams数值和metrics名称
writer
.
add_hparams
(
hparam_dict
=
{
'lr'
:
0.2
,
'bsize'
:
2
,
'opt'
:
'relu'
},
metric_list
=
[
'hparam/accuracy'
,
'hparam/loss'
])
writer
.
add_hparams
(
hparam
s
_dict
=
{
'lr'
:
0.2
,
'bsize'
:
2
,
'opt'
:
'relu'
},
metric
s
_list
=
[
'hparam/accuracy'
,
'hparam/loss'
])
# 通过将add_scalar接口中的tag与metrics名称对应,记录一次实验中不同step的metrics数值
for
i
in
range
(
10
):
writer
.
add_scalar
(
tag
=
'hparam/accuracy'
,
value
=
1.0
/
(
i
+
1
),
step
=
i
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录