Deep Learning For Beginners Mock Exam PDF
Deep Learning For Beginners Mock Exam PDF
Full Name*
Matriculation Number*
Course of Studies*
You can send me e-mails for upcoming events and open positions to the following
e-mail address** :
I have read all the information above and entered required data truthfully:
Signature
*
This data is required to identify you for the grading process.
**
This entry is optional and has no effect on the exam whatsoever. Only fill it in if you want to be put on a mailing
list from our lab.
1
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
For each of the following questions, mark all choices that apply. Each question has AT LEAST one correct
option unless otherwise stated. No explanation is required.
Question 1.1 1 P.
Can the XOR Problem be solved by a single layer Perceptron?
Yes
Only solvable with Support Vector Machines and not with Multilayer Perceptrons
Question 1.2 1 P.
The universal approximation theorem ...
provides theoretical guarantees on how closely a multi-layer neural network with a single hidden layer
can approximate a certain class of functions.
Question 1.3 1 P.
Which final activation function should be used for a multi-class problem (one-hot-encoded labels)?
Softmax
Sigmoid
TanH
ReLU
LeakyReLU
2
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
Question 1.4 1 P.
What is the purpose of the backpropagation algorithm?
Question 1.5 1 P.
What is the purpose of the Momentum used in different optimizers?
It stabilizes the training the gradient by averaging over multiple samples in a mini-batch.
It stabilizes the training by computing the moving average over the previous gradients.
Question 1.6 1 P.
Why is the signum function not used in deep learning?
Question 1.7 1 P.
Which of the following approaches can be used to reduce overfitting?
Data augmentation.
Dropout layers.
3
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
When dropout is used during training, it always causes a (small) increase in runtime during test time.
The larger the keep probability, the larger the regularization effect.
Question 1.9 1 P.
Which of the following statements about adversarial examples is true?
An adversarial example can be a slightly perturbed version of an input that yields a completely different
prediction.
They also exist for other machine learning approaches, e.g., support vector machines (SVMs).
4
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
2 Short Answers
Question 2.2 3 P.
During training of a network for the same task the three loss curves (a), (b), and (c) are observed, that
plot the loss over the number of iterations. Label whether the network was trained with SGD, mini-batch
gradient descent (MBGD) or batch gradient descent (BGD) (select one for each).
5
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
Question 2.4 2 P.
How do you have to set the padding on each side for a 2-D CONV layer to ensure that the output has the
same dimensions as the input? Describe np as a function of the filter width k. Assume a stride of 1.
Question 2.5 2 P.
You train a model with batch gradient descent that is supposed to differentiate images with apples and
with oranges, but you don’t get satisfactory performance. You inspect your training data and see that the
training data is not shuffled. Would it help to shuffle your training data? Explain your answer briefly.
Question 2.6 1 P.
You receive close-up images from shore regions and you are responsible for developing a system that auto-
matically classifies whether the current image contains trash or not. Assume that you have training data
with bounding-box annotations for each piece of trash. Briefly explain whether this is a form of weakly
supervised learning.
6
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
Imagine you are an employee for a software company that develops custom deep learning solutions. Your
manager gives you the task of developing a model that detects whether an image shows a horse or not. You
do not have to distinguish between one or many horses. Below are shown three example images of how the
data can look like.
(a) Horse: Yes, Dog: No (b) Horse: Yes, Dog: No (c) Horse: Yes, Dog: Yes
Question 3.2 1 P.
Which activation layer would be suitable to return the prediction of the model? (1 sentence)
7
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
Question 3.4 1 P.
Your manager further increases the complexity by the extending the problem as follows. In addition to the
horse prediction task, your model has to predict whether the given image contains a dog or not (like in
(c)). Both tasks, the horse prediction and the dog prediction need to be solved by the same model. Which
activation layer would be suitable to return the prediction of the model? (1 sentence)
Question 3.5 2 P.
For the samples in Figure 3, your model predicts the following output probabilities. Bases on these probabil-
ities, compute the prediction accuracy (threshold 0.5) for the class ”Horse” and the class ”Dog”, respectively.
8
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
Question 3.6 4 P.
You are given the framework of the programming exercises 3, 4, 5 and 6. Implement the Tanh layer
(Tanh(x)) using only numpy and basic python operations. Your layer must contain a constructor init ,
a method forward(input tensor) and a method backward(error tensor). Note: The exact recall of
numpy functions is not required to pass the task. You may instead “define” a suitable function, in this case
document this accordingly.
import numpy as np
class Tanh:
def init (self ):
# your code here
9
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
Convolutional neural networks represent an important concept in deep learning and play an essential role
in image processing.
Question 4.1 2 P.
Name two properties that are exploited in convolutional neural networks, especially compared to fully
connected architectures.
Question 4.2 4 P.
Assume that you have the convolutional neural network architecture described in the table below. Fill out
the missing columns accordingly. CONV-a-b represents a 2-D convolutional with a kernel size of a × a and
b output channels. POOL-2 represents an average pooling with a stride of 2 and a neighborhood size of
2 × 2. FC-c represents a fully connected layer with output size c. The input dimensions are always according
to the result of the previous layer. You can assume that “same” padding and a stride of 1 is used in the
CONV-layers.
Question 4.3 2 P.
What is the purpose of Layer 6 in the architecture defined in the table above? What is the benefit of having
this layer compared to skipping it? (2-3 sentences)
10
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
Question 4.4 2 P.
The network defined above is trained with images of size 32 × 32 and that has a flatten and fully connected
layers as the last layers in the network. You would like to reuse this pre-trained network for a related task
on a new data set with images of arbitrary size. How do you have to adapt the network architecture to be
able to process arbitrarily-sized images and still receive a vector of length 10 as output? (1-2 sentences)
Question 4.5 1 P.
What is the name of the method that re-uses pre-trained weights for related tasks?
11
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
5 Regularization
The fundamental goal of deep learning algorithms is to generalize beyond training sets.
Question 5.1 2 P.
The center in the bull’s eye diagram in Figure 4 is the desired model result that correctly predicts all values.
The farther you get from the center, the more incorrect the predictions become. Label the figure for all four
models and record your answers in the boxes.
Question 5.2 2 P.
The tradeoff between bias and variance is associated with the terms ”overfitting” and ”underfitting.” Which
of the models shown in Figure 4 leads to overfitting and which leads to underfitting. Explained by specifying
the bias and variance for the two selected models.
12
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
Question 5.3 2 P.
Name two classical techniques that you can apply to your dataset to prevent overfitting and explain what
you need to consider.
Question 5.4 2 P.
To reduce overfitting, you train one network with l2 regularization and a second network with l1 regu-
larization. How do you expect the respective weights to behave compared to training a network without
normalization?
13
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
Segmentation and object detection are tasks that are frequently encountered in signal processing tasks.
Question 6.1 3 P.
Describe the goal of semantic segmentation and outline the differences to object detection and instance
segmentation. (approx. 3 sentences)
14
Deep Learning for Beginners Prof. Dr.-Ing. Andreas Maier Pattern
Recognition
DLB - Mock exam September 29, 2021 Lab
conv1 = Relu(self.conv1(x))
pool1 = self.pool(conv1)
conv2 = Relu(self.conv2(pool1 ))
pool2 = self.pool(conv2)
return outconv
Question 6.2 1 P.
The kind of above architecture can be applied in the field of unsupervised learning to learn self-representation.
What are these architectures called in this case?
Question 6.3 1 P.
For above architecture: given an input of shape 1 × 3 × 256 × 256, what shape does the output have?
Question 6.4 1 P.
The architecture shown in Model is similar to the U-net architecture used in many medical image processing
tasks but is missing one key concept. What is the name of this concept?
Question 6.5 5 P.
Convert the architecture shown in Model to an U-Net by modifying/extending the code above.
Note: The exact recall of numpy functions is not required to pass the task. Please add documentation to
self defined functions.
15