IniziaInizia gratis

Creating a deep learning network

A deep convolutional neural network is a network that has more than one layer. Each layer in a deep network receives its input from the preceding layer, with the very first layer receiving its input from the images used as training or test data.

Here, you will create a network that has two convolutional layers.

Questo esercizio fa parte del corso

Image Modeling with Keras

Visualizza il corso

Istruzioni dell'esercizio

  • The first convolutional layer is the input layer of the network. This should have 15 units with kernels of 2 by 2 pixels. It should have a 'relu' activation function. It can use the variables img_rows and img_cols to define its input_shape.
  • The second convolutional layer receives its inputs from the first layer. It should have 5 units with kernels of 2 by 2 pixels. It should also have a 'relu' activation function.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

from keras.models import Sequential
from keras.layers import Dense, Conv2D, Flatten

model = Sequential()

# Add a convolutional layer (15 units)
____


# Add another convolutional layer (5 units)
____

# Flatten and feed to output layer
model.add(Flatten())
model.add(Dense(3, activation='softmax'))
Modifica ed esegui il codice