def cyclic_linear_lr(
    iteration: int,
    num_iterations_cycle: int,
    initial_lr: float,
    final_lr: float,
    ) -> float:
    """
    Linearly cycle learning rate

    Args:
        iteration: current iteration
        num_iterations_cycle: number of iterations per cycle
        initial_lr: learning rate to start cycle
        final_lr: learning rate to end cycle

    Returns:
        float: learning rate
    """
    cycle_iteration = int(iteration) % num_iterations_cycle
    lr_multiplier = 1 - (cycle_iteration / float(num_iterations_cycle))
    return initial_lr + (final_lr - initial_lr) * lr_multiplier