How it works...
In the previous recipe, Introduction to convolution operation, we built a simple CNN model. Apart from filter size and the number of filters, there are two more parameters of a convolution layer that can be configured for better feature extraction, and these are strides and padding. In step 1, we passed a vector of two integers (width and height), specifying the strides of the convolution along the width and height. The padding argument takes two values, valid, and same, with valid meaning no padding, and same means that the input and output sizes remain the same. Next, we printed a summary of the model.
The output shape and number of trainable parameters of a convolutional layer can be given by the following formula:
- Output ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access