(epoch)
return np.float(lr)
The learning rate begins at 10^initial_power,
    and decreases by a factor of 10 every step epochs.
The learning rate begins at 10^initial_power,
    and decreases by a factor of 10 every step epochs.
The learning rate begins at 10^initial_power and decreases by a factor of 10 every step epochs .
def step_decay(epoch):
    '''
    The learning rate begins at 10^initial_power,
    and decreases by a factor of 10 every step epochs.
    '''
    half_epoch = args.epochs // 2
    stage1, stage2, stage3 = int(half_epoch * 0.5), int(half_epoch * 0.8), half_epoch
    stage4 = stage3 + stage1
    stage5 = stage4 + (stage2 - stage1)
    stage6 = args.epochs

    if args.warmup_ratio:
        milestone = [2, stage1, stage2, stage3, stage4, stage5, stage6]
        gamma = [args.warmup_ratio, 1.0, 0.1, 0.01, 1.0, 0.1, 0.01]
    else:
        milestone = [stage1, stage2, stage3, stage4, stage5, stage6]
        gamma = [1.0, 0.1, 0.01, 1.0, 0.1, 0.01]

    lr = 0.005
    init_lr = args.lr
    stage = len(milestone)
    for s in range(stage):
        if epoch < milestone[s]:
            lr = init_lr * gamma[s]
            break
    print('Learning rate for epoch {} is {}.'.format(epoch + 1, lr))
    return np.float(lr)
def step_decay ( epoch ) : half_epoch = args . epochs // 2 stage1 , stage2 , stage3 = int ( half_epoch * 0.5 ) , int ( half_epoch * 0.8 ) , half_epoch stage4 = stage3 + stage1 stage5 = stage4 + ( stage2 - stage1 ) stage6 = args . epochs if args . warmup_ratio : milestone = [ 2 , stage1 , stage2 , stage3 , stage4 , stage5 , stage6 ] gamma = [ args . warmup_ratio , 1.0 , 0.1 , 0.01 , 1.0 , 0.1 , 0.01 ] else : milestone = [ stage1 , stage2 , stage3 , stage4 , stage5 , stage6 ] gamma = [ 1.0 , 0.1 , 0.01 , 1.0 , 0.1 , 0.01 ] lr = 0.005 init_lr = args . lr stage = len ( milestone ) for s in range ( stage ) : if epoch < milestone [ s ] : lr = init_lr * gamma [ s ] break print ( 'Learning rate for epoch {} is {}.' . format ( epoch + 1 , lr ) ) return np . float ( lr )