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

Fitting a neural network model to clothing data

In this exercise, you will fit the fully connected neural network that you constructed in the previous exercise to image data. The training data is provided as two variables: train_data that contains the pixel data for 50 images of the three clothing classes and train_labels, which contains one-hot encoded representations of the labels for each one of these 50 images. Transform the data into the network's expected input and then fit the model on training data and training labels.

The model you compiled in the previous exercise, and train_data and train_labels are available in your workspace.

Bu egzersiz

Image Modeling with Keras

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

Egzersiz talimatları

  • Prepare the data for fitting by reshaping it.
  • Fit the model by passing the input training data and training labels to the model's .fit() method.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Reshape the data to two-dimensional array
train_data = train_data.reshape(____, ____)

# Fit the model
model.fit(____, ____, validation_split=0.2, epochs=3)
Kodu Düzenle ve Çalıştır