Chapter 16, Deep Learning 15
• The ‘relu’ (Rectified Linear Unit) activation function is used to produce this
layer’s output (activation=‘relu’). ‘relu’ is the most widely used acti-
vation function in today’s deep learning networks and is good for perfor-
mance because it’s easy to calculate. It’s commonly recommended for convo-
lutional layers.
c. Assuming the Conv2D layer in Part (a) is the first layer of the network, we also
pass the input_shape=(28, 28,1) argument to specify the shape of each sam-
ple. This automatically creates an input layer to load the samples and pass them
into the Conv2D layer, which is actually the first hidden layer.
d. In Keras, for each subsequent layer you must explicitly specify the layer’s
input_shape to match the previous layer’s output shape, making it possible to
stack layers.
16.6 Q22: Which of the following statements is false?
a. Overfitting can occur when your model is too simple compared to what it is
modeling—in the most extreme overfitting case, a model memorizes its training
data.
b. When you make predictions with an overfit model, they will be accurate if new
data matches the training data, but the model could perform poorly with data it
has never seen.
c. Overfitting tends to occur in deep learning as the dimensionality of the layers
becomes too large.
d. Some techniques to prevent overfitting include training for fewer epochs, data
augmentation, dropout and L1 or L2 regularization.
16.6 Q23: Which of the following statements a), b) or c) is false?
a. To reduce overfitting and computation time, a convolution layer is often fol-
lowed by one or more layers that increase the dimensionality of the convolution
layer’s output.
b. A pooling layer compresses (or down-samples) the results by discarding fea-
tures, which helps make the model more general.
c. The most common pooling technique is called max pooling, which examines a
2-by-2 square of features and keeps only the maximum feature.
d. All of the above statements are true.