import math


def current_lr(t: int, max_t: int, initial_lr: float, final_lr: float) -> float:
    """
    Compute and return the current learning rate
    :param t: time step
    :param max_t: time step after then learning rate doesn't decrease anymore
    :param initial_lr: initial learning rate
    :param final_lr: final learning rate
    :return: the current learning rate
    """

    if max_t == 0 or initial_lr == 0:
        return final_lr  # use fix LR

    if t <= max_t:
        return math.exp((math.log(initial_lr) - math.log(final_lr)) * (max_t - t) / max_t + math.log(final_lr))
    else:
        return final_lr