Following what we did previously, we run a for loop and use the plt.imshow method to display the activation layers in the first, middle, and last filter values of a given neural network layer:
for i in range(0,12): current_layer_activation = activationsfig[i] ns = current_layer_activation.shape[-1] plt.imshow(current_layer_activation[0, :, :, 0], cmap='viridis') plt.imshow(current_layer_activation[0, :, :, int(ns/2)], cmap='viridis') plt.imshow(current_layer_activation[0, :, :, ns-1], cmap='viridis')
The following diagram shows the resulting output value of the chair image:
In the preceding diagram, ...