def relu_derivative(x):
    """An implementation of the ReLU derivative.

    Thanks to source:
    https://stackoverflow.com/questions/46411180/implement-relu-derivative-in-python-numpy
    """
    x[x<=0] = 0
    x[x>0] = 1
    return x