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

Dense layers

Once you have an Input layer, the next step is to add a Dense layer.

Dense layers learn a weight matrix, where the first dimension of the matrix is the dimension of the input data, and the second dimension is the dimension of the output data. Recall that your Input layer has a shape of 1. In this case, your output layer will also have a shape of 1. This means that the Dense layer will learn a 1x1 weight matrix.

In this exercise, you will add a dense layer to your model, after the input layer.

Bu egzersiz

Advanced Deep Learning with Keras

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

Egzersiz talimatları

  • Import the Dense layer function from keras.layers.
  • Create a Dense layer with 1 unit.
  • Pass input_tensor to output_layer().

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Load layers
from tensorflow.keras.layers import Input, ____

# Input layer
input_tensor = Input(shape=(1,))

# Dense layer
output_layer = ____

# Connect the dense layer to the input_tensor
output_tensor = output_layer(____)
Kodu Düzenle ve Çalıştır