swap optimizer.step and scheduler.step

This commit is contained in:
Zeyao Du
2019-08-20 15:58:42 +08:00
committed by GitHub
parent c589862b78
commit 28f7ca1f80

View File

@@ -602,8 +602,8 @@ def main():
nb_tr_examples += input_ids.size(0)
nb_tr_steps += 1
if (step + 1) % args.gradient_accumulation_steps == 0:
scheduler.step() # Update learning rate schedule
optimizer.step()
scheduler.step() # Update learning rate schedule
optimizer.zero_grad()
global_step += 1