!534 Check the relationship between min_lr and max_lr

Merge pull request !534 from fanglei/checkoutvalue
This commit is contained in:
mindspore-ci-bot 2020-04-21 19:34:53 +08:00 committed by Gitee
commit 97c9c72a12
1 changed files with 2 additions and 0 deletions

View File

@ -237,6 +237,8 @@ def cosine_decay_lr(min_lr, max_lr, total_step, step_per_epoch, decay_epoch):
validator.check_integer('total_step', total_step, 0, Rel.GT, None)
validator.check_integer('step_per_epoch', step_per_epoch, 0, Rel.GT, None)
validator.check_integer('decay_epoch', decay_epoch, 0, Rel.GT, None)
if min_lr >= max_lr:
raise ValueError('`max_lr` should be greater than `min_lr`.')
delta = 0.5 * (max_lr - min_lr)
lr = []