keras-vis
keras-vis copied to clipboard
filter_indices on dense layer can be set to any arbitrary integer.
I'm using a pretrained InceptionV3 network with two classes, heres the last few layers and parameters:
flatten (Flatten) (None, 2048) 0 max_pool[0][0]
____________________________________________________________________________________________________
predictions (Dense) (None, 2) 4098 flatten[0][0]
====================================================================================================
Total params: 21,806,882
Trainable params: 21,772,450
Non-trainable params: 34,432
____________________________________________________________________________________________________
When I use:
visualize_saliency(InceptionV3_model,layer_idx=312, filter_indices=0, seed_input=example_img, backprop_modifier='guided', grad_modifier="absolute"),alpha=0.5)
I thought I could set filter_indices to 0 or 1 to represent the classes? However, it allows me to set filter_indices to any arbitrary integer? For example, filter_indices = 2000. It supplies a different saliency map every time I change this integer (outside of the set [0,1] this doesn't make sense)
Why is this, I'm using the dense layer (layer_idx=312) I want to make sure I'm seeing the saliency map corresponding to each class. This doesn't seem to be the case.