(config, current_global_step, optimizer)
| 235 | |
| 236 | |
| 237 | def update_learning_rate(config, current_global_step, optimizer): |
| 238 | global last_global_step_from_restore |
| 239 | |
| 240 | global_step_for_lr = current_global_step - last_global_step_from_restore |
| 241 | lr_this_step = config["training"]["learning_rate"] * warmup_linear_decay_exp(global_step_for_lr, |
| 242 | config["training"]["decay_rate"], |
| 243 | config["training"]["decay_step"], |
| 244 | config["training"]["total_training_steps"], |
| 245 | config["training"]["warmup_proportion"]) |
| 246 | for param_group in optimizer.param_groups: |
| 247 | param_group['lr'] = lr_this_step |
| 248 | |
| 249 | return lr_this_step |
| 250 | |
| 251 | def report_step_metrics(args, lr, loss, step, data_sample_count): |
| 252 | ##### Record the LR against global_step on tensorboard ##### |
no test coverage detected