Visualizing multiple layers of activation

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, ...

Get Mastering Computer Vision with TensorFlow 2.x now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.