Keras Sequential Class

Sequential class

The Keras sequential class helps to form a cluster of a layer that is linearly stacked into tf.keras.Model. The features of training and inference are provided by sequential to this model.

Example






add Method

With the help of the add method, you will be permitted to add the layer's instance located at the top of the stack layer.

Arguments

  • layer: It can be defined as an instance of a layer.

Raises

  • TypeError: The TypeError is generated in case if the layer is not an instance of a layer.
  • ValueError: If the argument called layer is not aware of the shape of the input, then the ValueError is generated.
  • ValueError: In case if the layer argument encompasses several tensor output or simply, we can say it is connected anywhere like forbidden in the Sequential model.

pop Method

It helps in the removal of the last layer from the model.

Raises

  • TypeError: This type of error is generated if it consists of a single layer within the model.





Latest Courses