Sequential groups a linear stack of layers into a tf.keras.Model.

Inherits From: Model, Layer, Module

Used in the notebooks

Used in the guide Used in the tutorials

Sequential provides training and inference features on this model.


# Optionally, the first layer can receive an `input_shape` argument:
model = tf.keras.Sequential()
model.add(tf.keras.layers.Dense(8, input_shape=(16,)))
# Afterwards, we do automatic shape inference:
# This is identical to the following:
model = tf.keras.Sequential()