def lerp(global_step, start_step, end_step, start_val, end_val):
    """Utility function to linearly interpolate two values."""
    interp = (global_step - start_step) / (end_step - start_step)
    interp = max(0.0, min(1.0, interp))
    return start_val * (1.0 - interp) + end_val * interp