fix bug for warmup_steps setting

pull/2313/head
HydrogenSulfate 2022-09-19 14:37:15 +08:00
parent 0c0cc5e99c
commit 27101d3d88
1 changed files with 2 additions and 3 deletions

View File

@ -56,9 +56,8 @@ class LRBase(object):
self.step_each_epoch = step_each_epoch
self.learning_rate = learning_rate
self.warmup_epoch = warmup_epoch
self.warmup_steps = round(
self.warmup_epoch *
self.step_each_epoch) if by_epoch else self.warmup_epoch
self.warmup_steps = self.warmup_epoch if by_epoch else round(
self.warmup_epoch * self.step_each_epoch)
self.warmup_start_lr = warmup_start_lr
self.last_epoch = last_epoch
self.by_epoch = by_epoch