def linear_anneal(t, anneal_steps, start_e, end_e, start_steps):
    """
        Linearly anneals epsilon

        Args:
            t: Current time
            anneal_steps: Number of steps to anneal over
            start_e: Initial epsilon
            end_e: Final epsilon
            start_steps: Number of initial steps without annealing
    """
    assert end_e <= start_e
    t = max(0, t - start_steps)
    return max(end_e,
               (anneal_steps - t) * (start_e - end_e) / anneal_steps + end_e)