How would I implement the derivative of Leaky ReLU in Python without using Tensorflow?
Is there a better way than this? I want the function to return a numpy array
def dlrelu(x, alpha=.01):
# return alpha if x < 0 else 1
return np.array ([1 if i >= 0 else alpha for i in x])
Thanks in advance for the help
x
? Is it an array already? – Ecosystem