Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Image Modeling with Keras

Cursus bekijken

Oefeninstructies

  • 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.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

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'))
Code bewerken en uitvoeren