未验证 提交 c91cb2cf 编写于 作者: W wanghuancoder 提交者: GitHub

add ips print for ptb_lm (#4886)

* fix ptb_dy time print for benchmark, test=develop

* add ips print for ptb_lm
上级 69557e42
......@@ -456,11 +456,12 @@ def train_ptb_lm():
if batch_id > 0 and batch_id % log_interval == 0:
ppl = np.exp(total_loss / iters)
print(
"-- Epoch:[%d]; Batch:[%d]; ppl: %.5f, lr: %.5f, loss: %.5f, batch_cost: %.5f s, reader_cost: %.5f s"
"-- Epoch:[%d]; Batch:[%d]; ppl: %.5f, lr: %.5f, loss: %.5f, batch_cost: %.5f sec, reader_cost: %.5f sec, ips: %.5f words/sec"
% (epoch_id, batch_id, ppl[0],
sgd._global_learning_rate().numpy(), out_loss,
batch_cost_avg.get_average(),
reader_cost_avg.get_average()))
reader_cost_avg.get_average(),
batch_size / batch_cost_avg.get_average()))
batch_cost_avg.reset()
reader_cost_avg.reset()
batch_start = time.time()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册