Merge pull request #1251 from hankyul2/fix-multistep-scheduler

fix: multistep lr decay epoch bugs
pull/1256/head
Ross Wightman 3 years ago committed by GitHub
commit d30685c283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -71,7 +71,7 @@ def create_scheduler(args, optimizer):
elif args.sched == 'multistep': elif args.sched == 'multistep':
lr_scheduler = MultiStepLRScheduler( lr_scheduler = MultiStepLRScheduler(
optimizer, optimizer,
decay_t=args.decay_epochs, decay_t=args.decay_milestones,
decay_rate=args.decay_rate, decay_rate=args.decay_rate,
warmup_lr_init=args.warmup_lr, warmup_lr_init=args.warmup_lr,
warmup_t=args.warmup_epochs, warmup_t=args.warmup_epochs,

@ -171,6 +171,8 @@ parser.add_argument('--epoch-repeats', type=float, default=0., metavar='N',
help='epoch repeat multiplier (number of times to repeat dataset epoch per train epoch).') help='epoch repeat multiplier (number of times to repeat dataset epoch per train epoch).')
parser.add_argument('--start-epoch', default=None, type=int, metavar='N', parser.add_argument('--start-epoch', default=None, type=int, metavar='N',
help='manual epoch number (useful on restarts)') help='manual epoch number (useful on restarts)')
parser.add_argument('--decay-milestones', default=[30, 60], type=int, nargs='+', metavar="MILESTONES",
help='list of decay epoch indices for multistep lr. must be increasing')
parser.add_argument('--decay-epochs', type=float, default=100, metavar='N', parser.add_argument('--decay-epochs', type=float, default=100, metavar='N',
help='epoch interval to decay LR') help='epoch interval to decay LR')
parser.add_argument('--warmup-epochs', type=int, default=3, metavar='N', parser.add_argument('--warmup-epochs', type=int, default=3, metavar='N',

Loading…
Cancel
Save