# Understanding the difference between Sequential / Functional model

**URL:** <https://community.deeplearning.ai/t/understanding-the-difference-between-sequential-functional-model/192651>\
**Category:** Convolutional Neural Networks\
**Tags:** coursera-platform\
**Created:** [August 25, 2022, 8:45am UTC](https://community.deeplearning.ai/t/understanding-the-difference-between-sequential-functional-model/192651 "2022-08-25T08:45:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saradar](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@Saradar](https://community.deeplearning.ai/u/Saradar)\
**Post date:** [August 25, 2022, 8:45am UTC](https://community.deeplearning.ai/t/understanding-the-difference-between-sequential-functional-model/192651/1 "2022-08-25T08:45:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gent.spah](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/gent.spah/32/136423_2.png) [@gent.spah](https://community.deeplearning.ai/u/gent.spah)\
**Post date:** [August 25, 2022, 9:23am UTC](https://community.deeplearning.ai/t/understanding-the-difference-between-sequential-functional-model/192651/2 "2022-08-25T09:23:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Saradar](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@Saradar](https://community.deeplearning.ai/u/Saradar)\
**Post date:** [August 25, 2022, 9:44am UTC](https://community.deeplearning.ai/t/understanding-the-difference-between-sequential-functional-model/192651/3 "2022-08-25T09:44:06Z")

</div>

OK I got it , Thank U

---

<div class="post-metadata">

**Author:** ![ai\_curious](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/ai_curious/32/128003_2.png) [@ai\_curious](https://community.deeplearning.ai/u/ai_curious)\
**Post date:** [August 25, 2022, 12:32pm UTC](https://community.deeplearning.ai/t/understanding-the-difference-between-sequential-functional-model/192651/4 "2022-08-25T12:32:58Z")

</div>

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…

> **[Keras documentation: The Functional API](https://keras.io/guides/functional_api/)**
>
> Keras documentation: The Functional API

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.

 ![image](https://global.discourse-cdn.com/dlai/original/3X/2/0/20ea9ad0e9d3205461d88ea4c5e9cb04fc54e765.png)

---

<div class="post-metadata">

**Author:** ![gent.spah](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/gent.spah/32/136423_2.png) [@gent.spah](https://community.deeplearning.ai/u/gent.spah)\
**Post date:** [August 25, 2022, 1:33pm UTC](https://community.deeplearning.ai/t/understanding-the-difference-between-sequential-functional-model/192651/5 "2022-08-25T13:33:59Z")

</div>

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