Creating a DNN model
In this section, we will create a dense neural network using a Keras sequential model. The scope of the WIT example in this notebook is to explain the behavior of a model through its input data and outputs. However, we will outline a brief description of the DNN created in this section.
In a dense neural network, all of the neurons of a layer are connected to all of the layers of the previous layer, as shown in Figure 6.2:
Figure 6.2: Dense layers of a neural network
The graph shows that the first layer contains four neurons, the second layer two neurons, and the last layer will produce a binary result of 1
or 0
with its single neuron.
Each neuron in a layer will be connected to all the neurons of the previous layer.
In this model, each layer contains fewer neurons than the previous layer leading to a single neuron, which will produce a 0
or 1
output to make a prediction.
We now create the model and compile it:
...