Open Qinusty opened 5 years ago
I've run your code. But I could not reproduce the same result.
In [1]: import numpy as np
In [2]: a = np.array([1.0, -1.0])
In [3]: np.maximum(a, 0)
Out[3]: array([1., 0.])
In [4]: np.minimum(a, 0)
Out[4]: array([ 0., -1.])
I feel like this makes more sense as
np.minimum
?Based on the comment above and the results it produces.
An example can be seen below. Negative gradients are removed with
np.minimum()