as you go deeper in the network the number of channels is controlled by the first argument passed to the conv layers ( or the next step is to feed the last output tensor (of shape ( )into densely connected classifier network like those you're already familiar witha stack of dense layers these classifiers process vectorswhich are dwhereas the current output is tensor first we have to flatten the outputs to dand then add few dense layers on top listing adding classifier on op of he convnet model add(layers flatten()model add(layers dense( activation='relu')model add(layers dense( activation='softmax')we'll do -way classificationusing final layer with outputs and softmax activation here' what the network looks like nowmodel summary(layer (typeoutput shape param ===============================================================conv d_ (conv (none maxpooling d_ (maxpooling (none conv d_ (conv (none maxpooling d_ (maxpooling (none conv d_ (conv (none flatten_ (flatten(none dense_ (dense(none dense_ (dense(none ===============================================================total params , trainable params , non-trainable params as you can seethe ( outputs are flattened into vectors of shape ( ,before going through two dense layers nowlet' train the convnet on the mnist digits we'll reuse lot of the code from the mnist example in listing training he convnet on mnist images from keras datasets import mnist from keras utils import to_categorical (train_imagestrain_labels)(test_imagestest_labelsmnist load_data(licensed to