July 2019
Intermediate to advanced
512 pages
19h 39m
English
A functional model provides more flexibility than a sequential model. For instance, in a functional model, we can easily connect any layer to another layer, whereas, in a sequential model, each layer is in a stack of one above another. A functional model comes in handy when creating complex models, such as directed acyclic graphs, models with multiple input values, multiple output values, and shared layers. Now, we will see how to define a functional model in Keras.
The first step is to define the input dimensions:
input = Input(shape=(2,))
Now, we'll define our first fully connected layer with 10 neurons and relu activations, using the Dense class, as shown:
layer1 = Dense(10, activation='relu')
We defined ...
Read now
Unlock full access