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.
This exercise is part of the course
Advanced Deep Learning with Keras
Exercise instructions
- Import
Model
fromkeras.models
to create a keras model. - Use the input layer and output layer you already defined as the model's input and output.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# 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 = ____(____, ____)