The Basics of ConvNets
- What do you think applying this filter to a grayscale image will do?
- Detect 45-degree edges.
- Detect horizontal edges.
- Detect vertical edges.
- Detecting image contrast.
- Suppose your input is a 128 by 128 grayscale image, and you are not using a convolutional network. If the first hidden layer has 256 neurons, each one fully connected to the input, how many parameters does this hidden layer have (including the bias parameters)?
- 12583168
- 4194560
- 4194304
- 12582912
the number of inputs for each unit is 128×128 since the input image is grayscale, so we need 128×128×256 parameters for the weights and 256 parameters for the bias thus 128×128×256+256=4194560.
- Suppose your input is a 300 by 300 color (RGB) image, and you use a convolutional layer with 100 filters that are each 5x5. How many parameters does this hidden layer have (including the bias parameters)?
- 7500
- 7600
- 2501
- 2600
you have 25×3=75 weights and 1 bias per filter. Given that you have 100 filters, you get 7,600 parameters for this layer.
- You have an input volume that is 121 × \times × 121 × \times × 16, and convolve it with 32 filters of 4 × \times × 4, using a stride of 3 and no padding. What is the output volume?
- 40×40×16
- 40×40×32
- 118×118×32
- 118×118×16
using the formula n H [ l ] = ( n H [ l − 1 ] + 2 × p − f ) / s + 1 n^{[l]}_H=(n^{[l−1]}_H+2×p−f)/s+1 nH[l]=(nH[l−1]+2×p−f)/s+1 with n H [ l − 1 ] = 121 n^{[l−1]}_H=121 nH[l−1]=121, p = 0 p=0 p=0, f = 4 f=4 f=4, and s = 3 s=3 s=3 we get 40 40 40
- You have an input volume that is 61x61x32, and pad it using “pad=3”. What is the dimension of the resulting volume (after padding)?
- 64x64x32
- 67x67x32
- 64x64x35
- 61x61x35
- You have a volume that is 121×121×32, and convolve it with 32 filters of 5×5, and a stride of 1. You want to use a “same” convolution. What is the padding?
- 0
- 3
- 5
- 2
- You have an input volume that is 66x66x21, and apply max pooling with a stride of 3 and a filter size of 3. What is the output volume?
- 66×66×7
- 22×22×7
- 22×22×21
- 21×21×21
- Because pooling layers do not have parameters, they do not affect the backpropagation (derivatives) calculation.
- True
- False
Everything that influences the loss should appear in the backpropagation because we are computing derivatives. In fact, pooling layers modify the input by choosing one value out of several values in their input volume. Also, to compute derivatives for the layers that have parameters (Convolutions, Fully-Connected), we still need to backpropagate the gradient through the Pooling layers.
- In lecture we talked about “parameter sharing” as a benefit of using convolutional networks. Which of the following statements about parameter sharing in ConvNets are true? (Check all that apply)
- It allows gradient descent to set many of the parameters to zero, thus making the connections sparse.
- It allows a feature detector to be used in multiple locations throughout the whole input image/input volume.
- It allows parameters learned for one task to be shared even for a different task (transfer learning).
- It reduces the total number of parameters, thus reducing overfitting.
- In lecture we talked about “sparsity of connections” as a benefit of using convolutional layers. What does this mean?
- Each filter is connected to every channel in the previous layer.
- Each activation in the next layer depends on only a small number of activations from the previous layer.
- Each layer in a convolutional network is connected only to two other layers
- Regularization causes gradient descent to set many of the parameters to zero.
each activation of the output volume is computed by multiplying the parameters from only one filter with a volumic slice of the input volume and then summing all these together.