Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
281ae11d
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
281ae11d
编写于
1月 04, 2019
作者:
C
ccmeteorljh
提交者:
GitHub
1月 04, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1595 from ccmeteorljh/develop
add models time statistics for benchmark
上级
022c0899
f21a5a9c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
8 deletion
+16
-8
fluid/PaddleCV/gan/c_gan/c_gan.py
fluid/PaddleCV/gan/c_gan/c_gan.py
+5
-3
fluid/PaddleCV/gan/cycle_gan/train.py
fluid/PaddleCV/gan/cycle_gan/train.py
+5
-3
fluid/PaddleNLP/deep_attention_matching_net/train_and_evaluate.py
...ddleNLP/deep_attention_matching_net/train_and_evaluate.py
+2
-0
fluid/PaddleNLP/machine_reading_comprehension/run.py
fluid/PaddleNLP/machine_reading_comprehension/run.py
+4
-2
未找到文件。
fluid/PaddleCV/gan/c_gan/c_gan.py
浏览文件 @
281ae11d
...
...
@@ -165,7 +165,8 @@ def train(args):
'conditions'
:
conditions_data
},
fetch_list
=
{
dg_loss
})[
0
][
0
]
losses
[
1
].
append
(
dg_loss_n
)
t_time
+=
(
time
.
time
()
-
s_time
)
batch_time
=
time
.
time
()
-
s_time
t_time
+=
batch_time
...
...
@@ -180,8 +181,9 @@ def train(args):
fetch_list
=
{
g_img
})[
0
]
total_images
=
np
.
concatenate
([
real_image
,
generated_images
])
fig
=
plot
(
total_images
)
msg
=
"Epoch ID={0}
\n
Batch ID={1}
\n
D-Loss={2}
\n
DG-Loss={3}
\n
gen={4}"
.
format
(
pass_id
,
batch_id
,
d_loss_n
,
dg_loss_n
,
check
(
generated_images
))
msg
=
"Epoch ID={0}
\n
Batch ID={1}
\n
D-Loss={2}
\n
DG-Loss={3}
\n
gen={4}
\n
"
\
"Batch_time_cost={5:.2f}"
.
format
(
pass_id
,
batch_id
,
d_loss_n
,
dg_loss_n
,
check
(
generated_images
),
batch_time
)
print
(
msg
)
plt
.
title
(
msg
)
plt
.
savefig
(
...
...
fluid/PaddleCV/gan/cycle_gan/train.py
浏览文件 @
281ae11d
...
...
@@ -187,10 +187,12 @@ def train(args):
fetch_list
=
[
d_A_trainer
.
d_loss_A
],
feed
=
{
"input_A"
:
tensor_A
,
"fake_pool_A"
:
fake_pool_A
})[
0
]
t_time
+=
(
time
.
time
()
-
s_time
)
print
(
"epoch{}; batch{}; g_A_loss: {}; d_B_loss: {}; g_B_loss: {}; d_A_loss: {};"
.
format
(
batch_time
=
time
.
time
()
-
s_time
t_time
+=
batch_time
print
(
"epoch{}; batch{}; g_A_loss: {}; d_B_loss: {}; g_B_loss: {}; d_A_loss: {}; "
"Batch_time_cost: {:.2f}"
.
format
(
epoch
,
batch_id
,
g_A_loss
[
0
],
d_B_loss
[
0
],
g_B_loss
[
0
],
d_A_loss
[
0
]))
d_A_loss
[
0
]
,
batch_time
))
losses
[
0
].
append
(
g_A_loss
[
0
])
losses
[
1
].
append
(
d_A_loss
[
0
])
sys
.
stdout
.
flush
()
...
...
fluid/PaddleNLP/deep_attention_matching_net/train_and_evaluate.py
浏览文件 @
281ae11d
...
...
@@ -390,6 +390,8 @@ def train(args):
else
:
global_step
,
last_cost
=
train_with_feed
(
global_step
)
train_time
+=
time
.
time
()
-
begin_time
print
(
"Pass {0}, pass_time_cost {1}"
.
format
(
epoch
,
"%2.2f sec"
%
time
.
time
()
-
begin_time
))
# For internal continuous evaluation
if
"CE_MODE_X"
in
os
.
environ
:
print
(
"kpis train_cost %f"
%
last_cost
)
...
...
fluid/PaddleNLP/machine_reading_comprehension/run.py
浏览文件 @
281ae11d
...
...
@@ -446,7 +446,9 @@ def train(logger, args):
logger
.
info
(
'Dev eval result: {}'
.
format
(
bleu_rouge
))
pass_end_time
=
time
.
time
()
time_consumed
=
pass_end_time
-
pass_start_time
logger
.
info
(
'epoch: {0}, epoch_time_cost: {1:.2f}'
.
format
(
pass_id
,
time_consumed
))
logger
.
info
(
'Evaluating the model after epoch {}'
.
format
(
pass_id
))
if
brc_data
.
dev_set
is
not
None
:
...
...
@@ -459,7 +461,7 @@ def train(logger, args):
else
:
logger
.
warning
(
'No dev set is loaded for evaluation in the dataset!'
)
time_consumed
=
pass_end_time
-
pass_start_time
logger
.
info
(
'Average train loss for epoch {} is {}'
.
format
(
pass_id
,
"%.10f"
%
(
1.0
*
total_loss
/
total_num
)))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录