MulaiMulai sekarang secara 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.

Latihan ini adalah bagian dari kursus

Image Modeling with Keras

Lihat Kursus

Petunjuk latihan

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

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

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'))
Edit dan Jalankan Kode