def exponential_decay_fn(t, t0, t1, eps0, factor):
    """Exponentially decays.

    Args:
        t: Current step, starting from 0
        t0: Decay start
        t1: Decay end
        factor: Decay factor
        eps0: start learning rate
    """
    if t < t0:
        return eps0
    lr = eps0 * pow(factor, (t - t0) / (t1 - t0))
    return lr