visualizing what convnets learn listing running he model in predict mode activations activation_model predict(img_tensorreturns list of five numpy arraysone array per layer activation for instancethis is the activation of the first convolution layer for the cat image inputfirst_layer_activation activations[ print(first_layer_activation shape( it' feature map with channels let' try plotting the fourth channel of the activation of the first layer of the original model (see figure listing visualizing he fourt channel import matplotlib pyplot as plt plt matshow(first_layer_activation[ :: ]cmap='viridis'figure fourt channel of he activat ion of the first layer on he test cat picture this channel appears to encode diagonal edge detector let' try the seventh channel (see figure )--but note that your own channels may varybecause the specific filters learned by convolution layers aren' deterministic listing visualizing he sevent channel plt matshow(first_layer_activation[ :: ]cmap='viridis'licensed to