def fun_lr(lr, total_iters, warmup_total_iters, warmup_lr_start, iters):
    """Cosine learning rate with warm up."""
    factor = pow((1 - 1.0 * iters / total_iters), 0.9)
    if warmup_total_iters > 0 and iters < warmup_total_iters:
        factor = 1.0 * iters / warmup_total_iters
    return lr*factor