def polynomial_decay_learning_rate(step: int, learning_rate_start: float, learning_rate_final: float,
                                   decay_steps: int, power: float):
    """
    Manual implementation of polynomial decay for learning rate
    
    :param step: which step we're on
    :param learning_rate_start: learning rate for epoch 0
    :param learning_rate_final: learning rate for epoch decay_steps
    :param decay_steps: epoch at which learning rate stops changing
    :param power: exponent
    :return:
    """
    if step <= decay_steps:
        delta = float(learning_rate_start - learning_rate_final)
        lr = delta * (1.0 - float(step) / float(decay_steps)) ** power + learning_rate_final
        return lr
    return learning_rate_final