def update_lr(optimizer, epoch, num_epochs, base_lr=0.001, num_warmup_steps=3):
    lr = (lr_func_linear((epoch + 1), (num_epochs + 1), num_warmup_steps) * base_lr)
    optimizer = set_lr(optimizer, lr)
    return (optimizer, lr)
def update_lr(optimizer, epoch, num_epochs, base_lr=0.001, num_warmup_steps=3):
    lr = (lr_func_linear((epoch + 1), (num_epochs + 1), num_warmup_steps) * base_lr)
    optimizer = set_lr(optimizer, lr)
    return (optimizer, lr)