visualizing what convnets learn conv d_ (conv (none maxpooling d_ (maxpooling (none conv d_ (conv (none maxpooling d_ (maxpooling (none flatten_ (flatten(none dropout_ (dropout(none dense_ (dense(none dense_ (dense(none ===============================================================total params , , trainable params , , non-trainable params nextyou'll get an input image-- picture of catnot part of the images the network was trained on listing preprocessing single image img_path '/users/fchollet/downloads/cats_and_dogs_small/test/cats/cat jpgfrom keras preprocessing import image import numpy as np preprocesses the image into tensor img image load_img(img_pathtarget_size=( )img_tensor image img_to_array(imgimg_tensor np expand_dims(img_tensoraxis= img_tensor / its shape is ( print(img_tensor shaperemember that the model was trained on inputs that were preprocessed this way let' display the picture (see figure listing displaying the est pict ure import matplotlib pyplot as plt plt imshow(img_tensor[ ]plt show(licensed to