Hello, In some tf. keras tutorials, I’ve seen them instantiated their model class like this:
tf. keras
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.
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.
tf.keras.Model
tf.keras.Sequential