QCM 1: practice questions
QCM 1 takes place on 13/10/2026, after TD 2: 24 questions on lectures 1 and 2 and practical 1, 30 minutes, no documents, no calculator, exactly one correct answer per question, no negative points. The five questions below are of the same kind. Click an answer to check it.
1. How many trainable parameters (weights and biases) does the network Input(6) → Dense(4, ReLU) → Dense(2, softmax) have?
A Dense layer has nin × nout weights and nout biases. Dense(4) on 6 inputs: 6 × 4 + 4 = 28. Dense(2) on 4 inputs: 4 × 2 + 2 = 10. Total: 38.
2. Before any training, a 4-class softmax classifier outputs probabilities close to 1/4 for every class. What categorical cross-entropy (natural logarithm) and what accuracy do you expect on the validation set?
The loss of one example is −ln of the probability given to its true class: −ln(1/4) = ln 4 ≈ 1.39. A model that knows nothing picks the right class one time in four. With the 10 classes of MNIST this gives ln 10 ≈ 2.30, the value you measured before training in practical 1.
3. 90 % of the e-mails in a dataset are not spam. A classifier that always answers “not spam”, whatever the e-mail, reaches
Accuracy is misleading when the classes are imbalanced. The confusion matrix shows the problem at once: every spam lands in the “not spam” column.
4. The loss is E(w) = (w − 3)2. Starting from w = 0, one gradient-descent step with learning rate η = 0.2 gives
dE/dw = 2(w − 3) = −6 at w = 0. One step: w ← 0 − 0.2 × (−6) = 1.2. The slope is negative, so w increases, towards the minimum at w = 3.
5. Gradient descent is run on E(p) = 10 p2. For which learning rates does it converge to the minimum?
Write E = ½ k p2 with curvature k = 20. One step multiplies p by 1 − ηk, so the iterates go to 0 if and only if |1 − ηk| < 1, i.e. 0 < η < 2/k = 0.1.