Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Advanced Deep Learning with Keras

Cursus bekijken

Oefeninstructies

  • 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.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# 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 = ____(____, ____)
Code bewerken en uitvoeren