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

Training with Keras

In this exercise, we return to our sign language letter classification problem. We have 2000 images of four letters--A, B, C, and D--and we want to classify them with a high level of accuracy. We will complete all parts of the problem, including the model definition, compilation, and training.

Note that keras has been imported from tensorflow for you. Additionally, the features are available as sign_language_features and the targets are available as sign_language_labels.

Bu egzersiz

Introduction to TensorFlow in Python

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

Egzersiz talimatları

  • Define a sequential model named model.
  • Set the output layer to be dense, have 4 nodes, and use a softmax activation function.
  • Compile the model with the SGD optimizer and categorical_crossentropy loss.
  • Complete the fitting operation and set the number of epochs to 5.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Define a sequential model
____

# Define a hidden layer
model.add(keras.layers.Dense(16, activation='relu', input_shape=(784,)))

# Define the output layer
____

# Compile the model
model.compile('____', loss='____')

# Complete the fitting operation
model.fit(____, ____, epochs=____)
Kodu Düzenle ve Çalıştır