def log(begin_time, running_num_tks, running_mlm_loss, running_nsp_loss, step_num,<EOL>mlm_metric, nsp_metric, trainer, log_interval):
end_time = time.time()<EOL>duration = end_time - begin_time<EOL>throughput = running_num_tks / duration / <NUM_LIT><EOL>running_mlm_loss = running_mlm_loss / log_interval<EOL>running_nsp_loss = running_nsp_loss / log_interval<EOL>lr = trainer.learning_rate if trainer else <NUM_LIT:0><EOL>logging.info('<STR_LIT>'<EOL>.format(step_num, running_mlm_loss.asscalar(), mlm_metric.get()[<NUM_LIT:1>] * <NUM_LIT:100>, running_nsp_loss.asscalar(),<EOL>nsp_metric.get()[<NUM_LIT:1>] * <NUM_LIT:100>, throughput.asscalar(), lr, duration, duration*<NUM_LIT:1000>/log_interval))<EOL>
Log training progress.