QCM 2: practice questions
QCM 2 takes place on 03/11/2026, after TD 3: 24 questions on practical 2 and lecture 3 (convolutional networks), 30 minutes, no documents, no calculator, exactly one correct answer per question, no negative points. The test itself is in French. The five questions below are of the same kind. Click an answer to check it.
1. A 64 × 64 image goes through a Conv2D layer with 3 × 3 kernels, stride 1 and no padding (padding="valid"). Each output map measures
Without padding, the kernel only visits the positions where it fits entirely inside the image: n − k + 1 = 64 − 3 + 1 = 62 per row and per column. This is the 28 → 26 of model.summary() in practical 3.
2. How many trainable parameters (weights and biases) does a Conv2D(8, 3) layer, i.e. 8 filters of 3 × 3, have when applied to a colour image (3 channels)?
A filter has k × k × Cin weights and one bias: 3 × 3 × 3 + 1 = 28. Eight filters: 8 × 28 = 224. The size of the image does not enter: this is why convolutions need so few parameters.
3. Three convolution layers with 3 × 3 kernels (stride 1) are stacked. On how many pixels of the input image does each output of the third layer depend?
One 3 × 3 layer sees 3 × 3 pixels; each further 3 × 3 layer adds one pixel on each side: 3, 5, 7. Three small layers cover the same field as one 7 × 7 kernel, with fewer weights and three nonlinearities (the VGG argument).
4. What does padding="valid", the Keras default, mean for a Conv2D layer?
With "valid", a k × k kernel shrinks each side of the image by k − 1 pixels. padding="same" adds a border of zeros so that, with stride 1, the output keeps the size of the input.
5. In the dense class of practical 2, grad_weights = self.input.T @ error_out. For the layer dense(20, 8) (20 inputs, 8 outputs) and a batch of 64 examples, what is the shape of grad_weights?
(20, 64) @ (64, 8) gives (20, 8): the shape of the weights, as it must be, since grad_weights is subtracted from them. The matrix product adds up the contributions of the 64 examples.