import math


def step_decay(epoch):
    """
    Learning rate decay function. Decays the learning rate by one half every ten epochs

    Parameters
    ----------
    epoch: int
        Current training epoch
    """
    initial_l_rate = 0.001
    drop = 0.5
    epochs_drop = 10.0
    l_rate = initial_l_rate * math.pow(drop, math.floor((1 + epoch) / epochs_drop))
    return l_rate