The functional model is the more widely used of the two models. The key aspects of such a model are as follows:
- Multi-input, multi-output, and arbitrary static graph topologies
- Multi-input and multi-output models
- The complex model, which forks into two or more branches
- Models with shared layers
The following steps are similar to the sequential model's implementation, but with a number of changes. Here, we'll import the model, work on its architecture, and then train the network:
In[1]: import tensorflow as tf
In[2]: from tensorflow import keras
In[3]: from tensorflow.keras import layers
In[4]: inputs = keras.Input(shape=(10,))
In[5]: x= layers.Dense(20, activation='relu')(x)
In[6...