import math


def step_decay(epoch: int):
    """
    Learning rate scheduler.

    Parameters
    -----------
    epoch: int
        Number of epochs to perform

    Returns
    --------
    float
        Learning rate
    """
    initial_lrate = 1e-3
    drop = 0.5
    epochs_drop = 50.0
    lrate = initial_lrate * math.pow(drop, math.floor((1+epoch)/epochs_drop))
    return lrate