Deep Learning End Term: 1 September 2024 (May 2024 term)
The IIT Madras BS Deep Learning (Deep Learning) End Term paper sat on 1 Sept 2024, in the May 2024 term: 25 questions for 50 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.
- 25
- 50
- 180 min
- 11
- 13
- 1
Show answer
Correct answer: 5
Question 2
Consider a dataset with 150 samples and a batch size of 15. If each minibatch iteration contributes an average loss of 0.4, what will be the total loss after 15 epochs?
Show answer
Correct answer: 60
Question 3
If you use hierarchical softmax with a binary tree where each leaf node represents a word in the vocabulary, and the vocabulary size (V ) is 16000, how many binary classifiers are needed?
Show answer
Correct answer: 15999.5 (accepted within ±1.5)
Question 4
In a Skip-gram model with a vocabulary size V = 100, an embedding dimension D = 10, and a window size of 3 (on each side), using negative sampling with 5 negative samples per positive sample, what is the total number of parameters in the model?
Show answer
Correct answer: 2000
Question 5
Show answer
Correct answer: 176
Question 6
Consider a Transformer model with the following specifications for the decoder part:
- Input dimension (embedding size): 20
- Number of heads in multi-head attention: 2
- head output dimension: 10
- Dimension of feed-forward network: 16
- Number of layers in the decoder: 3
Assume that each decoder layer contains:
- One multi-head attention mechanism for self-attention.
- One multi-head attention mechanism for encoder-decoder attention.
- One feed-forward network.
- No bias terms are included.
Calculate the total number of parameters in the decoder part.
Show answer
Correct answer: 3680
Question 7
Consider a feedforward neural network with the following structure:
One input layer with 2 nodes
One hidden layer with 2 nodes
One output layer with 1 node
All weights and biases are initialized to zero. The activation function used in the hidden layer is the Rectified Linear Unit (ReLU), and the output layer uses the Sigmoid activation for binary classification. The network is trained with a binary cross-entropy loss function.
Two training examples are given: 1. Input vector: [2, -3], true label: 1 2. Input vector: [-1, 1], true label: 0
What will be the value of the total binary cross-entropy loss given these two training examples?
Show answer
Correct answer: 1.25 (accepted within ±0.25)
Question 8
A neural network has the following structure:
- Input Layer: , where
- Hidden Layers: Two hidden layers ( and ), each with 120 neurons, using the sigmoid activation function.
- Output Layer: with 8 neurons, using the softmax activation function.
Assuming that all weights between layers and are initialized to 0.2, with no bias associated with any neuron, what would be the computed cross-entropy loss for a given single data point? If the provided information is insufficient, please enter .
Show answer
Correct answer: 2.1 (accepted within ±0.1)
Question 9
Given an input array and a kernel/filter as follows:
- Convolve the kernel over the input with a stride and no padding to obtain matrix .
- Apply average pooling on to produce matrix .
- Pass through the sigmoid (logistic) function to get the final output .
Given that , determine the value of , where is the element of at index .
Show answer
Correct answer: 0.12 (accepted within ±0.1)
Question 10
What is the derivative of the ReLU activation function at x = 10?
Show answer
Correct answer: 1
Question 11
In terms of convergence speed, which gradient descent method can show the most rapid progress initially but may suffer from high variance in updates?
Batch Gradient Descent
Stochastic Gradient Descent
Mini-batch Gradient Descent
None of these
Show answer
Correct answer
Stochastic Gradient Descent
Question 12
How does the use of early stopping in training a neural network affect the model’s performance on unseen data?
It usually leads to better performance on unseen data by preventing overfitting
It generally worsens the performance on unseen data by halting training too early
It does not affect the performance on unseen data
It increases the risk of overfitting by allowing more epochs of training
Show answer
Correct answer
It usually leads to better performance on unseen data by preventing overfitting
Question 13
Which of the following statements is/are not true with respect to a dropout rate of 0.2?
The exact number of neurons dropped in each iteration will always be exactly 20%.
The exact number of neurons dropped and retained can vary slightly from one iteration to another due to the probabilistic nature of dropout.
Each neuron has a 20% chance of being dropped during any given training iteration.
Over many training iterations, the average percentage of retained neurons will approximate 80%.
Show answer
Correct answer
The exact number of neurons dropped in each iteration will always be exactly 20%.
Question 14
In the context of unsupervised pretraining of artificial neural networks, which of the following statements accurately describes the role and benefits of using unsupervised pretraining techniques for initializing a neural network?
Unsupervised pretraining methods help in identifying patterns in unlabeled data, which can be used to initialize weights and reduce the risk of overfitting in the subsequent supervised training phase.
The primary purpose of unsupervised pretraining is to generate synthetic data that can be used to expand the training dataset for the neural network, leading to more robust performance.
Unsupervised pretraining enables the network to learn a hierarchical representation of data, which can be fine-tuned with supervised learning, enhancing the model’s generalization capabilities.
Using unsupervised pretraining techniques ensures that the neural network can skip the initial training phase, directly achieving high accuracy on test data without further training.
Show answer
Correct answer
Unsupervised pretraining enables the network to learn a hierarchical representation of data, which can be fine-tuned with supervised learning, enhancing the model’s generalization capabilities.
Question 15
What are the maximum values of the derivatives of sigmoid and tanh?
1, 1
0.5, 0.5
0, 0.5
0.5, 0
0.25, 1
0.25, 0.5
Show answer
Correct answer
0.25, 1
Question 16
-0.477, 0
-0.301, 0
0.301, 0
0.477, 0.477
-0.477, 0.477
Show answer
Correct answer
-0.477, 0
Question 17
Given a matrix A with dimensions p × q, which of the following statements is NOT true regarding the rank-k approximation of A obtained through Singular Value Decomposition (SVD)?
Show answer
Correct answer
Question 18
Consider an encoder-decoder model trained with a batch size of 64. Each input sequence has a length of 12 tokens, and each output sequence has a length of 18 tokens. How many computational steps do the encoder and decoder take per batch respectively during training?
768, 1152
1152, 768
12, 18
18, 12
12, 1
1, 18
Show answer
Correct answer
768, 1152
Question 19
In an encoder-decoder model, what is the significance of the context vector?
It stores the hidden states of the decoder.
It summarizes the input sequence information to be used by the decoder.
It acts as the final output of the decoder.
It initiates the hidden states of the encoder.
It contains the parameters of the attention mechanism.
Show answer
Correct answer
It summarizes the input sequence information to be used by the decoder.
Question 20
Given the attention weights αt,1 = 0.3, αt,2 = 0.4, αt,3 = 0.3 and the corresponding encoder hidden states h1 = [2, 1, 0], h2 = [1, 2, 1], h3 = [0, 1, 2], calculate the context vector ct.
[0.7, 1.4, 0.9]
[1.1, 1.6, 1.3]
[0.6, 1.3, 0.9]
[1.1, 1.4, 1.1]
Show answer
Correct answer
[1.1, 1.6, 1.3]
Question 21
In the Transformer model, what is the purpose of the multi-head attention mechanism?
To allow the model to focus on different parts of the input sequence using different sets of attention weights.
To average the attention weights across multiple heads for more stable training.
To reduce the dimensionality of the input sequence before applying attention.
To apply attention in parallel across multiple layers of the Transformer model.
Show answer
Correct answer
To allow the model to focus on different parts of the input sequence using different sets of attention weights.
Question 22
In the context of the Transformer model’s encoder-decoder architecture, which of the following statements are correct?
The encoder processes the entire input sequence at once at a particular time step, and its output serves as the context for the decoder during generation.
The multi-head attention mechanism in the decoder allows the model to focus on different parts of the encoder’s output while generating the sequence.
The decoder applies self-attention over its entire sequence of inputs without any restrictions, allowing it to consider all future tokens at once.
The decoder’s self-attention mechanism includes a masking component to prevent attending to future positions, ensuring the model generates outputs one step at a time.
Show answer
Correct answers
The encoder processes the entire input sequence at once at a particular time step, and its output serves as the context for the decoder during generation.
The multi-head attention mechanism in the decoder allows the model to focus on different parts of the encoder’s output while generating the sequence.
The decoder’s self-attention mechanism includes a masking component to prevent attending to future positions, ensuring the model generates outputs one step at a time.
Question 23
In a time series prediction task using a GRU (Gated Recurrent Unit) network, the GRU processes input sequences where each input is represented by a 2-dimensional vector (). The GRU uses the following formulas for the hidden state and output at time step :
where denotes element-wise multiplication. Assume that and .
Based on the above data, answer the given subquestions.
Given that the GRU processes sequences of length 6 (T = 6), what is the total number of parameters (including biases) in the network?
Show answer
Correct answer: 113
Question 24
In a time series prediction task using a GRU (Gated Recurrent Unit) network, the GRU processes input sequences where each input is represented by a 2-dimensional vector (). The GRU uses the following formulas for the hidden state and output at time step :
where denotes element-wise multiplication. Assume that and .
Based on the above data, answer the given subquestions.
Show answer
Correct answer
Question 25
In a time series prediction task using a GRU (Gated Recurrent Unit) network, the GRU processes input sequences where each input is represented by a 2-dimensional vector (). The GRU uses the following formulas for the hidden state and output at time step :
where denotes element-wise multiplication. Assume that and .
Based on the above data, answer the given subquestions.
3 × 2
3 × 4
4 × 3
2 × 4
Show answer
Correct answer
3 × 4
