I am trying to pass a relu function to each individual element of a numpy array, when I try it with a sigmoid function, it works but with the relu function, it returns:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
relu function:
def relu(x):
return max(0, x)
sigmoid function:
def sigmoid(x):
return 1 / (1 + np.exp(-x))
I tried doing relu(myArray) but it returns the valueError, same with map(relu, myArray)
it works fine with sigmoid function, why is it doing that and how can I fix it? thanks