MulaiMulai sekarang secara gratis

Build a model

Once you've defined an input layer and an output layer, you can build a Keras model. The model object is how you tell Keras where the model starts and stops: where data comes in and where predictions come out.

Latihan ini adalah bagian dari kursus

Advanced Deep Learning with Keras

Lihat Kursus

Petunjuk latihan

  • Import Model from keras.models to create a keras model.
  • Use the input layer and output layer you already defined as the model's input and output.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Input/dense/output layers
from tensorflow.keras.layers import Input, Dense
input_tensor = Input(shape=(1,))
output_tensor = Dense(1)(input_tensor)

# Build the model
from tensorflow.keras.models import ____
model = ____(____, ____)
Edit dan Jalankan Kode