- Why does the output of a convolutional layer have a smaller width and height than the input, unless it is padded?
The spatial dimensions of the output of a convolutional layer represent the number of valid positions the kernels could take when sliding over the input tensors, vertically and horizontally. Since kernels span over k × k pixels (if square), the number of positions they can take over the input image without being partially out of it can only be equal to (if k = 1), or less than, the image dimensions.
This is expressed by the equations presented in the chapter, to compute the output dimensions based on the layer's hyper parameters.
- What would be the output of a max-pooling layer with a receptive field of (2, 2) and a stride of 2 on the input matrix in Figure 3-6?
- How could LeNet-5 be implemented using the Keras Functional API in a non-object-oriented manner ?
The code is as follows:
from tensorflow.keras import Model
from tensorflow.keras.layers...