keras-vis icon indicating copy to clipboard operation
keras-vis copied to clipboard

Possible miscalculation within grad-cam

Open Qinusty opened this issue 6 years ago • 1 comments

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()

>> a = np.array([1.0, -1.0])
>> np.maximum(a, 0)
[0, -1.0]
>> np.minimum(a, 0)
[1.0, -1.0]

Qinusty avatar Apr 22 '19 12:04 Qinusty

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.])

keisen avatar Apr 25 '19 04:04 keisen