Skip to content

Commit

Permalink
fix ildoonet#18 (warmlr for multiplier=1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryul99 committed Nov 25, 2020
1 parent 6b5e895 commit 565aae0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion warmup_scheduler/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def step_ReduceLROnPlateau(self, metrics, epoch=None):
epoch = self.last_epoch + 1
self.last_epoch = epoch if epoch != 0 else 1 # ReduceLROnPlateau is called at the end of epoch, whereas others are called at beginning
if self.last_epoch <= self.total_epoch:
warmup_lr = [base_lr * ((self.multiplier - 1.) * self.last_epoch / self.total_epoch + 1.) for base_lr in self.base_lrs]
warmup_lr = self.get_lr()
for param_group, lr in zip(self.optimizer.param_groups, warmup_lr):
param_group['lr'] = lr
else:
Expand Down

0 comments on commit 565aae0

Please sign in to comment.