Keras Sequential API

Learn to create DL models using the Sequential API of Keras.

Keras offers different ways to create DL models. Let’s focus on the sequential Keras model.

Building DL models

The different ways to build DL models in Keras include:

  • The Sequential model class: This allows us to define a DL model in a single line of code.

  • The Functional interface: This can create complicated model architectures.

  • The Model subclass: This uses object-oriented concepts to allow us to reuse models.

The Sequential model class

We use the Sequential model class to create a DL model consisting of a sequence of layers arranged one after the other. When each model layer has only one input tensor and one output tensor, we use the Sequential model. The following lines import the Sequential model.

Get hands-on with 1200+ tech skills courses.