A statement that implements the NUMpy array relu activation function

This is the implementation of numpy array, less than zero elements assigned to zero. Similar to the activation function in the neural network, see the code:

Idata = 1 * (Idata > 0) * Idata
Copy the code

You can break it down

temp = Idata > 0
temp = 1 * temp
Idata = temp * Idata
Copy the code

I found it while programming, python is so powerful!!