diff --git a/dygraph/ptb_lm/ptb_dy.py b/dygraph/ptb_lm/ptb_dy.py index 48ff9bb7bdc3c210c8586bc744e10307c52a3b27..c4980bcbdbafb0316a4a6cce18df1a2f8a25f705 100644 --- a/dygraph/ptb_lm/ptb_dy.py +++ b/dygraph/ptb_lm/ptb_dy.py @@ -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()