BaşlayınÜcretsiz Başlayın

Convolutional network for image classification

Convolutional networks for classification are constructed from a sequence of convolutional layers (for image processing) and fully connected (Dense) layers (for readout). In this exercise, you will construct a small convolutional network for classification of the data from the fashion dataset.

Bu egzersiz

Image Modeling with Keras

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Add a Conv2D layer to construct the input layer of the network. Use a kernel size of 3 by 3. You can use the img_rows and img_cols objects available in your workspace to define the input_shape of this layer.
  • Add a Flatten layer to translate between the image processing and classification part of your network.
  • Add a Dense layer to classify the 3 different categories of clothing in the dataset.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import the necessary components from Keras
from keras.models import Sequential
from keras.layers import Dense, Conv2D, Flatten

# Initialize the model object
model = Sequential()

# Add a convolutional layer
model.add(____(10, kernel_size=____, activation='relu', 
               input_shape=____))

# Flatten the output of the convolutional layer
model.add(____())
# Add an output layer for the 3 categories
model.add(____(____, activation='softmax'))
Kodu Düzenle ve Çalıştır