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
  1. 2026-01-q12026Q01Generalization vs training speedmedium1 pt
    Every training trick mainly serves one of two goals: better generalization, or better training speed/stability. For each technique, indicate which goal it primarily addresses.
  2. 2026-02-q12026Q01Perceptron & Hebbian learning historymedium2 pts
    For each of the following statements, indicate whether it is true or false.
    • The reason people did not develop Multi-Layer Perceptrons (MLPs) further after 1969 was that they were going to be, in any case, linear classifiers, and because of this, Feed-Forward Neural Networks were introduced.
    • In Hebbian learning, for each wrongly-predicted sample the weight $w_i$ is modified by adding a quantity proportional to the input (the perceptron/Hebbian update rule).
    • Since the activation function of the perceptron model is a STEP or SIGN function, then the decision boundary is nonlinear.
    • Hebbian learning is a supervised training procedure.
    • The Perceptron model was presented originally in the book by Marvin Minsky and Seymour Papert, "Perceptrons: an introduction to computational geometry".
  3. 2026-06-q12026Q01Universal approximation theoremmedium2 pts
    A 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.
    • Provided I use enough S-shaped (sigmoid or tanh) hidden neurons, a single hidden layer feed-forward neural network can approximate any continuous function on a compact set with arbitrary accuracy.
    • There are tasks where applying single hidden layer neural networks straight to raw data shows no significant robustness or invariance, e.g., image or text classification.
    • We can stack as many hidden layers of S-shaped (sigmoid or tanh) functions as we want and will always be able to learn the desired approximation for both regression and classification — the more the better.
    • A single hidden layer feed-forward network can SOLVE both regression and classification with the desired accuracy, given enough S-shaped neurons in that layer.
  4. 2026-01-q22026Q02Learning ratemedium2 pts
    The learning rate is a critical hyper-parameter of gradient descent because … (select all that apply)
  5. 2026-02-q22026Q02Activation-function gradients & vanishing gradientmedium1 pt
    The vanishing gradient problem comes from multiplying many small gradients during backpropagation. Match each activation function's gradient bound to its value.
  6. 2026-06-q22026Q02Advances that improved gradient-descent trainingmedium2 pts
    Feed-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)
  7. 2026-01-q32026Q03word2vechard2 pts
    With reference to the word2vec model, mark each statement as true or false.
    • word2vec embeddings represent discrete words and therefore cannot be added or subtracted.
    • word2vec is unsupervised because it does not minimise a learning loss — it merely optimises vector distances in the embedding space.
    • word2vec improved on one-hot encoding because it is sparse and therefore represents words with fewer parameters.
    • word2vec is not trained in an unsupervised manner.
    • word2vec is unsupervised because it implements a classical neural autoencoder architecture.
  8. 2026-02-q32026Q03What controls overfittingmedium2 pts
    According 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)
  9. 2026-06-q32026Q03Designing an age-estimation vision systemhard3 pts
    A 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.
  10. 2026-01-q42026Q04Sequence model design choiceshard2 pts
    For each design choice, mark True if the model AND its stated assumptions make sense, or False if they do not.
    • To build a multi-set encoder, one-hot items are sorted and fed one at a time to a zero-initialised LSTM whose final state encodes the multi-set; the same multi-set is therefore always encoded identically.
    • A simple spellchecker can be built from a bidirectional LSTM to get a look-ahead effect and avoid the representation bottleneck.
    • For sentence sentiment, a 2-layer stacked model made of two bidirectional LSTM layers followed by a sigmoid output is a legitimate design.
    • To build a set encoder, one-hot items are fed one at a time to a zero-initialised LSTM; because the LSTM is permutation invariant, the same set is always encoded the same way.
    • To reverse a sentence with a sequential model we cannot use an LSTM (generation must go forward autoregressively) and must instead use a bidirectional LSTM.
  11. 2026-02-q42026Q04When to use binary cross-entropymedium1 pt
    Based on what was explained in class, select the tasks that are trained using the binary cross-entropy loss. (select all that apply)
  12. 2026-06-q42026Q04Reverse-engineering a time-series modelhard2 pts
    A 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)
  13. 2026-01-q52026Q05Convolution, correlation & templateshard2 pts
    Mark all the true statements (wrong answers are penalised).
  14. 2026-02-q52026Q05LSTMeasy0.5 pts
    What does LSTM stand for?
  15. 2026-06-q52026Q05Counting word2vec (CBOW) parametersmedium1.5 pts
    You 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.
  16. 2026-01-q62026Q06Convolution as a linear operatorhard2 pts
    Mark all the true statements (wrong answers are penalised).
  17. 2026-02-q62026Q06Sequence-model input/output shapeshard2 pts
    For 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.
  18. 2026-06-q62026Q06Class Activation Mapping (CAM)hard2.5 pts
    The 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)
  19. 2026-01-q72026Q07Object detection & the R-CNN familyhard2 pts
    Mark all the true statements about object detection (wrong answers are penalised).
  20. 2026-02-q72026Q07Neural language models & word2vechard2 pts
    Consider neural language models and word2vec architectures. Which of the following statements are correct? (select all that apply)
  21. 2026-06-q72026Q07Size-preserving layers between activation mapsmedium1.5 pts
    A 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
    
  22. 2026-01-q82026Q08Counting CNN parametershard2.5 pts
    For 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)
    
  23. 2026-02-q82026Q08Famous CNN architectureshard2 pts
    Mark all the statements that are true. (wrong answers are penalised)
  24. 2026-06-q82026Q08Pooling layersmedium1.5 pts
    Mark 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)
  25. 2026-01-q92026Q09Reading a dense output headhard2 pts
    The 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)
  26. 2026-02-q92026Q09Semantic segmentation & fully-convolutional networkshard2 pts
    Mark all the statements that are true. (wrong answers are penalised)
  27. 2026-02-q102026Q10CAM & Grad-CAM explainabilityhard2 pts
    Mark all the statements that are true. (wrong answers are penalised)
  28. 2026-06-q102026Q10Counting parameters of a conv autoencoderhard3 pts
    For 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)
    
  29. 2026-06-q112026Q11What a conv autoencoder can be trained forhard2 pts
    The 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)
  30. 2026-02-q122026Q12Counting CNN parameters & output shapeshard2.5 pts
    For 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
    
  31. 2026-02-q132026Q13Multi-task heads — classification + regressionhard2 pts
    A 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)
  32. 2025-q12025Q01Generalization vs training performancemedium2 pts
    For 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.
  33. 2025-q22025Q02Choosing an architecture for signalshard1 pt
    Taps, touches and knocks on a car door are captured by vibration sensors and turned into actions. Select every implementation that is correct.
  34. 2025-q32025Q03Attention vs self-attentionhard3 pts
    Attention (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?
  35. 2025-q42025Q04Regression design choicesmedium2 pts
    In the general setting of regression, which of the following statements hold true (each considered independently)? (select all that apply)
  36. 2025-q52025Q05Word embeddingsmedium2 pts
    Mark each statement about word embeddings as true or false (considered independently).
    • Word embedding turns a one-hot word representation into a dense vector representation.
    • Training a word embedding can be considered an unsupervised (self-supervised) learning task.
    • In word2vec the embedding-space regularity (a constant difference vector for analogous concepts) is imposed explicitly by a dedicated loss at training time.
    • Skip-gram and Continuous Bag-of-Words are two possible implementations of the word2vec model.
  37. 2025-q62025Q06Linear image classifierhard2 pts
    A 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).
  38. 2025-q72025Q07Receptive fieldhard1 pt
    What 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)
    
  39. 2025-q82025Q08Semantic segmentationhard2 pts
    Consider a properly trained semantic-segmentation network and mark all the true statements (wrong answers are penalised).
  40. 2025-q92025Q09Counting CNN parametershard3 pts
    For 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)
    
  41. 2025-q102025Q11Reading an output headhard2 pts
    A 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)
  42. 2024-q12024Q01Supervised vs unsupervisedeasy1 pt
    For each task, state whether the model can be trained in an unsupervised fashion, or whether it necessarily needs supervision (an expert labeller).
  43. 2024-q22024Q02Vanishing gradientmedium4 pts
    The 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?
  44. 2024-q32024Q03Transformers & self-attentionhard3 pts
    Consider the Transformer model and its building blocks. Mark each statement as true or false, based on technical considerations (not on how it is phrased).
    • We can have very deep Transformer architectures and still train them, because the residual connections in every Transformer block limit the vanishing-gradient issue.
    • The positional-encoding mechanism based on sinusoidal and cosinusoidal functions of token positions is used by all Transformers whenever they encode position.
    • Transformers require both an encoder and a decoder stage — "encoder-only" or "decoder-only" Transformers cannot be trained.
    • Given the same input sequence twice in two separate executions, a Transformer produces the same output sequence both times.
    • In Multi-Head Attention it is possible to "cross" queries/keys/values coming from the encoder and the decoder.
    • Because self-attention is "permutation invariant", feeding a reversed sentence to a self-attention layer yields the same result as the forward sentence.
  45. 2024-q42024Q04Sequence model designhard2 pts
    You 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)
  46. 2024-q52024Q06Transfer learning & augmentationhard1 pt
    Check all the statements that are true (wrong answers are penalised).
  47. 2024-q62024Q07Fully convolutional networkshard2 pts
    Mark all the sentences that are correct (any wrong answer results in a penalty).
  48. 2024-q72024Q09Counting CNN parametershard4 pts
    For 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)
    
  49. 2024-q82024Q10Reading an output headhard2 pts
    A 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)