Understanding the difference between Sequential / Functional model

Just to make sure that I understand the difference between the two models , If we have a model that should classify between 5 types of animals ( So the output layer should be Softmax , So there is a multiple output ) we cant use Sequential because it doesn’t support multiple inputs / outputs

Is that Right , thanks A lot

No, that is one output with 5 classes (you can use a softmax) and sequential model can be used. The functional type would be used when you have different outputs at different layers of the network.

2 Likes

OK I got it , Thank U

On point as usual from @gent.spah. But you might ask yourself, ‘Why would I ever want or need to have multiple outputs from my neural network?’ Well, what if in addition to the categorical classification that used softmax to predict animal class or type, you wanted at the same time to perform a binary classification on whether the animal was adult or juvenile (a drone doing a population survey in a National Park?) The functional model allows you to do just that.

See the section

Manipulate complex graph topologies

Models with multiple inputs and outputs

at this page for more…

Tl;dr. Here is a picture of a model architecture from that linked Keras guide that has 3 inputs and 2 outputs. One output is categorical, one is binary. This kind of topology can’t be created using the Sequential Model alone, though you could define small sections using Sequential and wire them together using Functional.

2 Likes

It is true @ai_curious I am a bit laconic in my answers​:grin:. I hope you are doing well over there. However I enjoy reading and actually learn new things from your elaborate answers too.