def compute_lr(target_lr, n_epochs, train_set_size, batch_size, warmup):
    total = ((n_epochs - 1) * int(np.ceil((train_set_size / batch_size))))
    progress = [(float(t) / total) for t in range(0, total)]
    factor = [((p / warmup) if (p < warmup) else max(((p - 1.0) / (warmup - 1.0)), 0.0)) for p in progress]
    lr = [(f * target_lr) for f in factor]
    return lr
def compute_lr(target_lr, n_epochs, train_set_size, batch_size, warmup):
    total = ((n_epochs - 1) * int(np.ceil((train_set_size / batch_size))))
    progress = [(float(t) / total) for t in range(0, total)]
    factor = [((p / warmup) if (p < warmup) else max(((p - 1.0) / (warmup - 1.0)), 0.0)) for p in progress]
    lr = [(f * target_lr) for f in factor]
    return lr