Get startedGet started for free

How many parameters in a deep CNN?

In this exercise, you will use Keras to calculate the total number of parameters along with the number of parameters in each layer of the network.

We have already provided code that builds a deep CNN for you.

This exercise is part of the course

Image Modeling with Keras

View Course

Exercise instructions

Summarize the network, providing a count of the number of parameters.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# CNN model
model = Sequential()
model.add(Conv2D(10, kernel_size=2, activation='relu', 
                 input_shape=(28, 28, 1)))
model.add(Conv2D(10, kernel_size=2, activation='relu'))
model.add(Flatten())
model.add(Dense(3, activation='softmax'))

# Summarize the model 
____
Edit and Run Code