What is the difference between tf.keras.model and tf.keras.sequential?

Hello,
In some tf. keras tutorials, I’ve seen them instantiated their model class like this:

model = tf.keras.Sequential()

While in some places, they use something like this:

model = tf.keras.Model(inputs=input, outputs=output)

I 'd like know What are the differences between the two?

This line

tf.keras.Model(inputs=input, outputs=output)

fuctions like model.build (like putting the pieces in one box) if you have come across. It basically builds the model with inputs to outputs while the

Instatiates the model that you you can build up with with layers.

2 Likes

To add up, tf.keras.Model is quite powerful as it enable you build models without any of the drawbacks of tf.keras.Sequential eg you can build models with multiple inputs and/or outpus in tf.keras.Model but not the latter.

2 Likes