Sequential and Functional model

What is the difference between sequential and functional models?
Which one is used more ?

Have you been through the second exercise in ConvNets Week 1 (Convolutional Model Application)? They go through all this. Maybe you could wish for better explanations than they give, but they do at least try to explain it. And they coach you through the creation of a Sequential Model first and then a Functional Model.

The short summary is that a Sequential Model is simpler to define, but less flexible. It only allows a simple structure where there is an input to each layer and one output and you feed the output of the first layer as the input to the second and so forth. So you can’t implement an architecture that has “skip” connections or multiple inputs per layer using the Sequential Model.

The Functional API is fully general: you get to specify the inputs and outputs and can create any architecture you want, but it takes a bit more code to specify.

Here’s the documentation for the Sequential Model.

Here’s the documentation for the Functional API.

In terms of frequency of use, I think it all depends: if you can get away with the Sequential Model, then it’s easier so why not use it. But (as mentioned above) it doesn’t work for anything that’s not a simple and straightforward sequential process.

1 Like

I got it! Thank you for your assistance!

1 Like