Add strides to a convolutional network
The size of the strides of the convolution kernel determines whether the kernel will skip over some of the pixels as it slides along the image. This affects the size of the output because when strides are larger than one, the kernel will be centered on only some of the pixels.
Latihan ini adalah bagian dari kursus
Image Modeling with Keras
Petunjuk latihan
Construct a neural network with a Conv2D layer with strided convolutions that skips every other pixel.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
# Initialize the model
model = Sequential()
# Add the convolutional layer
model.add(Conv2D(10, kernel_size=3, activation='relu',
input_shape=(img_rows, img_cols, 1),
____))
# Feed into output layer
model.add(Flatten())
model.add(Dense(3, activation='softmax'))