Deep Learning - CNN - Convolutional Neural Network - Keras Functional Model Tutorial
The Keras functional API is a way to create models that are more flexible than the Sequential API. The functional API can handle models with non-linear topology, shared layers, and even multiple inputs or outputs. The main idea is that a deep learning model is usually a directed acyclic graph (DAG) of layers. So the functional API is a way to build graphs of layers.
How to build non-linear Neural Networks?
The problem with the sequential model is there is linear topology, i.e. 1 input→ 1 output→ Linear
but for non-linear topology, suppose from the human face we need to detect age and emotion i.e. 2 output, which is not possible through linear topology. It required non-linear topology.
Non-linear topology is not possible with sequential API, but it is possible with Functional API.
Non-linear neural networks train different types of data with different models, for example, tabular data is trained by a Fully connected layer, textual data is trained with RNN and image data is trained with CNN.
To train such data we need non-linear topology, for non-linear topology we need functional API.