Exam practice
Deep Learning — Practice
Past-exam questions, filterable by chapter, year and difficulty. Answer for instant grading, reveal the worked solution, and watch your accuracy climb.
Seen 0 / 49 · 0 correct · 0% accuracy
Chapter
Year
Difficulty
- 2026-01-q1Every training trick mainly serves one of two goals: better generalization, or better training speed/stability. For each technique, indicate which goal it primarily addresses.
- 2026-02-q1For each of the following statements, indicate whether it is true or false.
- 2026-06-q1A former colleague recalls being taught that "one layer of a (fully connected) feed-forward neural network is sufficient for any task, i.e., regression and classification". Judge each statement below about that claim, based on what we know today. Treat each as independent, but all referring to the quoted sentence.
- 2026-01-q2The learning rate is a critical hyper-parameter of gradient descent because … (select all that apply)
- 2026-02-q2The vanishing gradient problem comes from multiplying many small gradients during backpropagation. Match each activation function's gradient bound to its value.
- 2026-06-q2Feed-forward networks are still trained by gradient descent, but several advances have made that training more effective. Select every item below that is such a recognised improvement. (select all that apply)
- 2026-01-q3With reference to the word2vec model, mark each statement as true or false.
- 2026-02-q3According to what was presented in class, which of the following is NOT directly involved in dealing with overfitting? "Directly" means it controls overfitting, or plays a role in a technique meant for overfitting control. (select all that apply)
- 2026-06-q3A fashion store wants computer-vision software that predicts the age of people entering, so each customer is served by the most appropriate clerk. Multiple customers may enter simultaneously. (a) Describe how you would design the architecture of the application. (b) Describe the model(s) it uses in terms of architecture, training data, and loss function.
- 2026-01-q4For each design choice, mark True if the model AND its stated assumptions make sense, or False if they do not.
- 2026-02-q4Based on what was explained in class, select the tasks that are trained using the binary cross-entropy loss. (select all that apply)
- 2026-06-q4A model takes two real-valued, synchronized time series from two sensors on an industrial machine and decides whether the machine works properly. From this minimal description, which of the following are properly educated guesses about layers of the model? Judge each independently, using classical best practices from the course. (select all that apply)
- 2026-01-q5Mark all the true statements (wrong answers are penalised).
- 2026-02-q5What does LSTM stand for?
- 2026-06-q5You train a word2vec CBOW model from scratch on a corpus of 1380 unique terms, embedding each into a vector of 32 elements, with the output matrix W' tied as the transpose of the embedding matrix W. How many trainable parameters does the network have at training time? Assume the input matrix W is 1380×32, plus a hidden bias of 32 and an output bias of 1380.
- 2026-01-q6Mark all the true statements (wrong answers are penalised).
- 2026-02-q6For each sequential-data problem, select the most appropriate model shape. The two many-to-many variants are: encoder–decoder (delayed) — the whole input is read before the whole output is generated; and synchronous — one output is produced at each input step.
- 2026-06-q6The following statements concern Class Activation Mapping (CAM), as in the original paper seen in lectures. Mark all the sentences that are correct — stick to what a neural-network expert would actually do, not what is merely possible in Python. (select all that apply)
- 2026-01-q7Mark all the true statements about object detection (wrong answers are penalised).
- 2026-02-q7Consider neural language models and word2vec architectures. Which of the following statements are correct? (select all that apply)
- 2026-06-q7A stack of 36-channel activation maps is passed between two points of a network. Which of the following layers can be plugged in between them WITHOUT changing the tensor's channel count or spatial size? (select all that apply)
import torch import torch.nn as nn - 2026-01-q8For the PyTorch model below (in_channels = 3, num_classes = 3, input 256×256), how many total parameters does the summary report?
self.c0 = nn.Conv2d(3, 32, kernel_size=3, padding=1) self.p1 = nn.MaxPool2d(2, 2) self.c1 = nn.Conv2d(32, 64, kernel_size=3, padding=1) self.p2 = nn.MaxPool2d(2, 2) self.c2 = nn.Conv2d(64, 128, kernel_size=3, padding=1) self.d = nn.Dropout(0.2) self.u1 = nn.Upsample(scale_factor=2) # cat with r1 -> 192 in-ch self.c3 = nn.Conv2d(192, 64, kernel_size=3, padding=1) self.u2 = nn.Upsample(scale_factor=2) # cat with r0 -> 96 in-ch self.c4 = nn.Conv2d(96, 32, kernel_size=3, padding=1) self.c5 = nn.Conv2d(32, 16, kernel_size=1, padding=0) self.c6 = nn.Conv2d(16, 8, kernel_size=1, padding=0) self.output = nn.Conv2d(8, num_classes, kernel_size=1) - 2026-02-q8Mark all the statements that are true. (wrong answers are penalised)
- 2026-06-q8Mark all the correct statements about pooling layers — answer as a neural-network expert would, not merely what is possible in Python. (select all that apply)
- 2026-01-q9The PyTorch network keeps the spatial size and outputs three channels per pixel (a 256×256×3 image), trained with an MSE loss — i.e. a dense image-to-image regression. Mark every task it can be trained for. (select all that apply)
- 2026-02-q9Mark all the statements that are true. (wrong answers are penalised)
- 2026-02-q10Mark all the statements that are true. (wrong answers are penalised)
- 2026-06-q10For the PyTorch model below, called with INPUT_SIZE = (3, 32, 64), how many total parameters does summary(model, input_size=INPUT_SIZE) report?
import torch import torch.nn as nn import torch.nn.functional as F from torchsummary import summary class Model(nn.Module): def __init__(self, input_shape): super().__init__() in_channels = input_shape[0] self.c1 = nn.Conv2d(in_channels, 64, kernel_size=4, stride=2, padding=1) self.mp1 = nn.MaxPool2d(kernel_size=2, stride=2) self.c2 = nn.Conv2d(64, 128, kernel_size=4, stride=2, padding=1) self.mp2 = nn.MaxPool2d(kernel_size=2, stride=2) self.c3 = nn.Conv2d(128, 256, kernel_size=1, padding=0) self.c4 = nn.Conv2d(256, 128, kernel_size=1, padding=0) self.do1 = nn.Dropout(0.2) self.c5 = nn.Conv2d(128, 256, kernel_size=1, padding=0) self.up2 = nn.Upsample(scale_factor=4, mode="nearest") self.c6 = nn.Conv2d(256, 128, kernel_size=4, padding=0) self.up3 = nn.Upsample(scale_factor=4, mode="nearest") self.c7 = nn.Conv2d(128, 64, kernel_size=4, padding=0) self.output_layer = nn.Conv2d(64, in_channels, kernel_size=1, padding=0) def forward(self, x): x = F.relu(self.c1(x)); x = self.mp1(x) x = F.relu(self.c2(x)); x = self.mp2(x) x = F.relu(self.c3(x)); x = F.relu(self.c4(x)) x = self.do1(x) x = F.relu(self.c5(x)) x = self.up2(x); x = F.pad(x, (1, 2, 1, 2)) x = F.relu(self.c6(x)) x = self.up3(x); x = F.pad(x, (1, 2, 1, 2)) x = F.relu(self.c7(x)) x = torch.sigmoid(self.output_layer(x)) return x INPUT_SIZE = (3, 32, 64) model = Model(INPUT_SIZE) summary(model, input_size=INPUT_SIZE) - 2026-06-q11The network from the previous question maps a 3×32×64 input to a 3×32×64 output through a sigmoid, trained with an MSE loss — a dense image-to-image regression. Assuming you always have the required training data and cannot change the architecture or training options, mark every task it can be trained for. (select all that apply)
- 2026-02-q12For the PyTorch model below (in_channels = 3, num_classes = 3, input image 256×256), complete the model summary: give the output shape (C, H, W) and the number of parameters of every layer, plus the total number of parameters. Recall a conv layer has $(k_h\,k_w\,C_\text{in}+1)\,C_\text{out}$ parameters and a linear layer has $(\text{in}+1)\,\text{out}$.
class Model(nn.Module): def __init__(self, in_channels=3, num_classes=3, dropout_rate=0.5): super().__init__() self.conv0 = nn.Conv2d(in_channels, 16, kernel_size=3, padding='same') self.relu0 = nn.ReLU() self.mp0 = nn.MaxPool2d(kernel_size=2, stride=2) self.conv1 = nn.Conv2d(16, 32, kernel_size=3, padding='same') self.relu1 = nn.ReLU() self.mp1 = nn.MaxPool2d(kernel_size=2, stride=2) self.conv2 = nn.Conv2d(32, 64, kernel_size=3, padding='same') self.relu2 = nn.ReLU() self.mp2 = nn.MaxPool2d(kernel_size=2, stride=2) self.conv3 = nn.Conv2d(64, 128, kernel_size=3, padding='same') self.relu3 = nn.ReLU() self.avgpool = nn.AdaptiveAvgPool2d((1, 1)) self.seq1 = nn.Sequential(nn.Dropout(dropout_rate), nn.Linear(128, num_classes)) self.seq2 = nn.Sequential(nn.Dropout(dropout_rate), nn.Linear(128, 4)) def forward(self, x): x = self.mp0(self.relu0(self.conv0(x))) x = self.mp1(self.relu1(self.conv1(x))) x = self.mp2(self.relu2(self.conv2(x))) x = self.relu3(self.conv3(x)) x = self.avgpool(x) x = torch.flatten(x, 1) out_1 = self.seq1(x) out_2 = self.seq2(x) return out_1, out_2 - 2026-02-q13A CNN has a shared convolutional backbone and a GAP feeding two heads: a 3-way softmax classification head (trained with cross-entropy) and a 4-output linear regression head (trained with MSE). It produces one label out of three and exactly four real values per image. Mark every task this network can be trained for — assume the data is available and you may not change the architecture. (wrong answers are penalised)
- 2025-q1For each technique, say whether it primarily improves the final model's generalization, or the performance of the training procedure (backpropagation) — including convergence speed and training stability.
- 2025-q2Taps, touches and knocks on a car door are captured by vibration sensors and turned into actions. Select every implementation that is correct.
- 2025-q3Attention (in seq2seq models) and self-attention (in Transformers) both help models handle sequential data. Answer each part separately (graded 1 point each). (1) What is the difference between attention and self-attention? (2) What is the difference between dot-product, Luong and Bahdanau scoring in terms of the number of learned parameters? (3) What is encoder–decoder attention and how does it work?
- 2025-q4In the general setting of regression, which of the following statements hold true (each considered independently)? (select all that apply)
- 2025-q5Mark each statement about word embeddings as true or false (considered independently).
- 2025-q6A network classifies images over 10 classes: the input is flattened and connected directly to the output layer (no hidden layer). Mark all the true statements (wrong answers are penalised).
- 2025-q7What is the receptive field (one side, in pixels) of the network below, given a 500×500 input image?
x = tfkl.Conv2D(16, kernel_size=3, padding='valid', activation='relu')(input_layer) x = tfkl.MaxPooling2D(4)(x) x = tfkl.Conv2D(32, kernel_size=5, padding='valid', activation='relu')(x) x = tfkl.MaxPooling2D(3)(x) x = tfkl.Conv2D(64, kernel_size=7, padding='valid', activation='relu')(x) x = tfkl.MaxPooling2D(2)(x) x = tfkl.Conv2D(128, kernel_size=9, padding='valid', activation='relu')(x) x = tfkl.MaxPooling2D(1)(x) - 2025-q8Consider a properly trained semantic-segmentation network and mark all the true statements (wrong answers are penalised).
- 2025-q9For the model below, called with input_shape = (228, 116, 3) and output_number = 6, how many total parameters does model.summary() report?
input_layer = tfkl.Input(shape=input_shape) c1 = tfkl.Conv2D(32, 5, padding='valid', activation='relu')(input_layer) c1 = tfkl.BatchNormalization()(c1) c1 = tfkl.AveragePooling2D(pool_size=(4, 4))(c1) c1 = tfkl.Dropout(0.25)(c1) s1 = tfkl.Conv2D(64, 1, padding='same', activation='relu')(c1) s1 = tfkl.Conv2D(32, 5, padding='same', activation='relu')(s1) s1 = tfkl.Add()([c1, s1]) c2 = tfkl.Conv2D(64, 5, padding='same', activation='relu')(s1) c2 = tfkl.BatchNormalization()(c2) c2 = tfkl.AveragePooling2D(pool_size=(4, 4))(c2) c2 = tfkl.Dropout(0.25)(c2) s2 = tfkl.Conv2D(128, 1, padding='same', activation='relu')(c2) s2 = tfkl.Conv2D(64, 5, padding='same', activation='relu')(s2) s2 = tfkl.Add()([c2, s2]) gmp = tfkl.GlobalMaxPooling2D()(s2) fc1 = tfkl.Dense(128, activation='relu')(gmp) fc1 = tfkl.BatchNormalization()(fc1) fc2 = tfkl.Dense(64, activation='relu')(fc1) output_layer = tfkl.Dense(output_number, activation='linear')(fc2) - 2025-q10A CNN outputs six values through Dense(6, activation='linear') and is trained with a mean-absolute-error loss. Assuming all needed labels are available and the architecture is fixed, mark every task it can be trained for. (select all that apply)
- 2024-q1For each task, state whether the model can be trained in an unsupervised fashion, or whether it necessarily needs supervision (an expert labeller).
- 2024-q2The vanishing gradient is a well-known issue in deep neural networks. Answer each part in a focused, concise way. (1) What is the vanishing gradient issue? (2) What is it due to? (3) Which network architectures are particularly affected by it? (4) Which techniques can be used to limit it?
- 2024-q3Consider the Transformer model and its building blocks. Mark each statement as true or false, based on technical considerations (not on how it is phrased).
- 2024-q4You want to train a deep model to reproduce the "Clever Hans" tapping behaviour: produce a sequence of taps until "something" changes in the posture/face of the person a camera is filming. Which statements about suitable architectural choices are correct? (select all that apply)
- 2024-q5Check all the statements that are true (wrong answers are penalised).
- 2024-q6Mark all the sentences that are correct (any wrong answer results in a penalty).
- 2024-q7For the model below, called with input_shape = (224, 112, 3) and output_number = 6, how many total parameters does model.summary() report?
input_layer = tfkl.Input(shape=input_shape) # Block 1 c1 = tfkl.Conv2D(64, 7, padding='same', activation='relu')(input_layer) c1 = tfkl.MaxPooling2D()(c1) c1 = tfkl.Dropout(0.2)(c1) s1 = tfkl.Conv2D(128, 1, padding='same', activation='relu')(c1) s1 = tfkl.Conv2D(64, 7, padding='same', activation='relu')(s1) s1 = tfkl.Add()([c1, s1]) # Block 2 c2 = tfkl.Conv2D(128, 7, padding='same', activation='relu')(s1) c2 = tfkl.MaxPooling2D()(c2) c2 = tfkl.Dropout(0.2)(c2) s2 = tfkl.Conv2D(256, 1, padding='same', activation='relu')(c2) s2 = tfkl.Conv2D(128, 7, padding='same', activation='relu')(s2) s2 = tfkl.Add()([c2, s2]) # Head s2 = tfkl.GlobalAveragePooling2D()(s2) s2 = tfkl.Dense(64)(s2) s2 = tfkl.BatchNormalization()(s2) s2 = tfkl.Dense(64)(s2) output_layer = tfkl.Dense(output_number, activation='linear')(s2) - 2024-q8A CNN ends in Dense(6, activation='linear') and is trained with a mean-squared-error loss — i.e. it regresses six real numbers from an image. Assuming the required training data is always available and you may not change the architecture, mark every task it can be trained for. (select all that apply)