IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Image Modeling with Keras

Visualizza il corso

Istruzioni dell'esercizio

Construct a neural network with a Conv2D layer with strided convolutions that skips every other pixel.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# 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'))
Modifica ed esegui il codice