Open eyaler opened 5 years ago
Hi, @eyaler . Thank you for your request.
To create the option you said is so easy, but I'm wondering if I should do it.
Something doesn't feel right with that the saliency function return the raw gradients, because it is the Gradient, not the Saliency.
I believe we should use vis.optimizer.Optimizer
when we want to get raw gradients.
opt = Optimizer(input_tensor, losses, wrt_tensor=wrt_tensor, norm_grads=False)
grads = opt.minimize(seed_input=seed_input, max_iter=1, grad_modifier=grad_modifier, verbose=False)[1]
I'd like to get your thoughts on this.
But, if we think the gradient is just used as the saliency, it should do it. I'm little bit confusing :confused:
also there is a potential problem with this line: normalized = (array - arr_min) / (arr_max - arr_min + K.epsilon()) since array values can be in the magnitude of epsilon... maybe we should use max(arr_max - arr_min, K.epsilon())
and the thing is that normalizing the gradients will always highlight something. but for finding negative evidence the magnitude is important
also: grads = grads / (np.max(grads) + K.epsilon()) in grad cam
in saliency functions we have
utils.normalize(grads)[0]
i want an option to get the raw gradients for thresholding or comparing between filters