(optimizer, epoch, cfg)
Decay the learning rate based on schedule
Decay the learning rate based on schedule
Decay the learning rate based on schedule
def adjust_learning_rate(optimizer, epoch, cfg):
    """Decay the learning rate based on schedule"""
    lr = cfg['LR']
    for milestone in cfg['STAGES']:
        lr *= 0.1 if epoch >= milestone else 1.
    for param_group in optimizer.param_groups:
        param_group['lr'] = lr
def adjust_learning_rate ( optimizer , epoch , cfg ) : lr = cfg [ 'LR' ] for milestone in cfg [ 'STAGES' ] : lr *= 0.1 if epoch >= milestone else 1. for param_group in optimizer . param_groups : param_group [ 'lr' ] = lr