def one_cycle_schedule_inv(step, total_steps, warmup_steps=None, hold_min_steps=0, m_max=.95, m_min=.85):
    """ Create a schedule with a momentum that increases linearly after
    linearly decreasing during a warmup period.
    """
    if warmup_steps is None:
        warmup_steps = (total_steps - hold_min_steps) // 2
    
    if step < warmup_steps:
        m = m_max + (step - 0) * ((m_min - m_max) / (warmup_steps - 0))
    elif step < warmup_steps + hold_min_steps:
        m = m_min
    else:
        current_percentage = step / total_steps
        if current_percentage <= .9:
            m = m_min + (step - warmup_steps - hold_min_steps) * ((m_max - m_min) / ((total_steps * .9) - warmup_steps - hold_min_steps))
        else:
            m = m_max

    return m