Dropout and Flatten
In this section, we'll actually construct the neural network model and use Dropout
and Flatten
in order to create a complete neural network.
We'll start off by using the functional Keras model to actually assemble neural networks, looking at the input and layer stacks in order to assemble a neural network end to end. Then, we'll explain why we have Dropout
and Flatten
, and what effect they have on your model. Finally, we'll show a model summary: This is a way that you can visualize the total number of parameters and layers in a machine learning model.
Here, we're using what is known as the functional model of Keras. You can think of a neural network as a series of layers, with each one of those layers being defined by a function. The function passes a set of parameters to configure the layer, and then you hand it, as a parameter, to the previous layer in your network to chain them all together. This tiny block of code, as shown in the following screenshot, is actually a...