Quiz Space

May 2024 term · Deep Learning · BSCS3004

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.

Questions
25
Marks
50
Duration
180 min
Numerical
11
MCQ
13
MSQ
1

Updated

Official paper: IIT M DEGREE AN EXAM QDB3 01 Sep 2024 · No negative marking.

Question 1

+2 marksNumerical answer
Show answer

Correct answer: 5

Question 2

+2 marksNumerical answer

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

+2 marksNumerical answer

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

+2 marksNumerical answer

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

+2 marksNumerical answer
Show answer

Correct answer: 176

Question 6

+2 marksNumerical answer

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

+3 marksNumerical answer

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

+3 marksNumerical answer

A neural network has the following structure:

  • Input Layer: h0=x\mathbf{h_0} = \mathbf{x}, where x∈R100\mathbf{x} \in \mathbb{R}^{100}
  • Hidden Layers: Two hidden layers (h1\mathbf{h_1} and h2\mathbf{h_2}), each with 120 neurons, using the sigmoid activation function.
  • Output Layer: O\mathbf{O} with 8 neurons, using the softmax activation function.

Assuming that all weights between layers h2\mathbf{h_2} and O\mathbf{O} 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 −1-1.

Show answer

Correct answer: 2.1 (accepted within ±0.1)

Question 9

+3 marksNumerical answer

Given an input array XX and a kernel/filter KK as follows:

X=[−1−102−21001−1−100001]X = \begin{bmatrix} -1 & -1 & 0 & 2 \\ -2 & 1 & 0 & 0 \\ 1 & -1 & -1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}

K=[010110011]K = \begin{bmatrix} 0 & 1 & 0 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \end{bmatrix}

  • Convolve the kernel KK over the input XX with a stride s=1s = 1 and no padding to obtain matrix AA.
  • Apply average pooling on AA to produce matrix BB.
  • Pass BB through the sigmoid (logistic) function to get the final output y^\hat{y}.

Given that ∂L∂y^=−1\frac{\partial L}{\partial \hat{y}} = -1, determine the value of ∂L∂K00\frac{\partial L}{\partial K_{00}}, where K00K_{00} is the element of KK at index (0,0)(0, 0).

Show answer

Correct answer: 0.12 (accepted within ±0.1)

Question 10

+1 markNumerical answer

What is the derivative of the ReLU activation function at x = 10?

Show answer

Correct answer: 1

Question 11

+1 markOne correct option

In terms of convergence speed, which gradient descent method can show the most rapid progress initially but may suffer from high variance in updates?

  1. A

    Batch Gradient Descent

  2. B

    Stochastic Gradient Descent

  3. C

    Mini-batch Gradient Descent

  4. D

    None of these

Show answer

Correct answer

  • B

    Stochastic Gradient Descent

Question 12

+1 markOne correct option

How does the use of early stopping in training a neural network affect the model’s performance on unseen data?

  1. A

    It usually leads to better performance on unseen data by preventing overfitting

  2. B

    It generally worsens the performance on unseen data by halting training too early

  3. C

    It does not affect the performance on unseen data

  4. D

    It increases the risk of overfitting by allowing more epochs of training

Show answer

Correct answer

  • A

    It usually leads to better performance on unseen data by preventing overfitting

Question 13

+2 marksOne correct option

Which of the following statements is/are not true with respect to a dropout rate of 0.2?

  1. A

    The exact number of neurons dropped in each iteration will always be exactly 20%.

  2. B

    The exact number of neurons dropped and retained can vary slightly from one iteration to another due to the probabilistic nature of dropout.

  3. C

    Each neuron has a 20% chance of being dropped during any given training iteration.

  4. D

    Over many training iterations, the average percentage of retained neurons will approximate 80%.

Show answer

Correct answer

  • A

    The exact number of neurons dropped in each iteration will always be exactly 20%.

Question 14

+2 marksOne correct option

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?

  1. A

    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.

  2. B

    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.

  3. C

    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.

  4. D

    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

  • C

    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

+2 marksOne correct option

What are the maximum values of the derivatives of sigmoid and tanh?

  1. A

    1, 1

  2. B

    0.5, 0.5

  3. C

    0, 0.5

  4. D

    0.5, 0

  5. E

    0.25, 1

  6. F

    0.25, 0.5

Show answer

Correct answer

  • E

    0.25, 1

Question 16

+2 marksOne correct option
  1. A

    -0.477, 0

  2. B

    -0.301, 0

  3. C

    0.301, 0

  4. D

    0.477, 0.477

  5. E

    -0.477, 0.477

Show answer

Correct answer

  • A

    -0.477, 0

Question 17

+2 marksOne correct option

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)?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 18

+2 marksOne correct option

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?

  1. A

    768, 1152

  2. B

    1152, 768

  3. C

    12, 18

  4. D

    18, 12

  5. E

    12, 1

  6. F

    1, 18

Show answer

Correct answer

  • A

    768, 1152

Question 19

+2 marksOne correct option

In an encoder-decoder model, what is the significance of the context vector?

  1. A

    It stores the hidden states of the decoder.

  2. B

    It summarizes the input sequence information to be used by the decoder.

  3. C

    It acts as the final output of the decoder.

  4. D

    It initiates the hidden states of the encoder.

  5. E

    It contains the parameters of the attention mechanism.

Show answer

Correct answer

  • B

    It summarizes the input sequence information to be used by the decoder.

Question 20

+2 marksOne correct option

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.

  1. A

    [0.7, 1.4, 0.9]

  2. B

    [1.1, 1.6, 1.3]

  3. C

    [0.6, 1.3, 0.9]

  4. D

    [1.1, 1.4, 1.1]

Show answer

Correct answer

  • B

    [1.1, 1.6, 1.3]

Question 21

+2 marksOne correct option

In the Transformer model, what is the purpose of the multi-head attention mechanism?

  1. A

    To allow the model to focus on different parts of the input sequence using different sets of attention weights.

  2. B

    To average the attention weights across multiple heads for more stable training.

  3. C

    To reduce the dimensionality of the input sequence before applying attention.

  4. D

    To apply attention in parallel across multiple layers of the Transformer model.

Show answer

Correct answer

  • A

    To allow the model to focus on different parts of the input sequence using different sets of attention weights.

Question 22

+2 marksOne or more correct options

In the context of the Transformer model’s encoder-decoder architecture, which of the following statements are correct?

Select all that apply.

  1. A

    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.

  2. B

    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.

  3. C

    The decoder applies self-attention over its entire sequence of inputs without any restrictions, allowing it to consider all future tokens at once.

  4. D

    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

  • A

    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.

  • B

    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.

  • D

    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

+2 marksNumerical answer

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 (xt∈R2x_t \in \mathbb{R}^2). The GRU uses the following formulas for the hidden state and output at time step tt:

it=σ(Wist−1+Uixt+bi)ot=σ(Wost−1+Uoxt+bo)s~t=tanh⁡(Uxt+W(ot⊙st−1)+b)st=(1−it)⊙st−1+it⊙s~ty^t=Vht+c\begin{aligned} i_t &= \sigma(W_i s_{t-1} + U_i x_t + b_i) \\ o_t &= \sigma(W_o s_{t-1} + U_o x_t + b_o) \\ \tilde{s}_t &= \tanh(Ux_t + W(o_t \odot s_{t-1}) + b) \\ s_t &= (1 - i_t) \odot s_{t-1} + i_t \odot \tilde{s}_t \\ \hat{y}_t &= Vh_t + c \end{aligned}

where ⊙\odot denotes element-wise multiplication. Assume that ht∈R3h_t \in \mathbb{R}^3 and y^t∈R2\hat{y}_t \in \mathbb{R}^2.

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

+2 marksOne correct option

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 (xt∈R2x_t \in \mathbb{R}^2). The GRU uses the following formulas for the hidden state and output at time step tt:

it=σ(Wist−1+Uixt+bi)ot=σ(Wost−1+Uoxt+bo)s~t=tanh⁡(Uxt+W(ot⊙st−1)+b)st=(1−it)⊙st−1+it⊙s~ty^t=Vht+c\begin{aligned} i_t &= \sigma(W_i s_{t-1} + U_i x_t + b_i) \\ o_t &= \sigma(W_o s_{t-1} + U_o x_t + b_o) \\ \tilde{s}_t &= \tanh(Ux_t + W(o_t \odot s_{t-1}) + b) \\ s_t &= (1 - i_t) \odot s_{t-1} + i_t \odot \tilde{s}_t \\ \hat{y}_t &= Vh_t + c \end{aligned}

where ⊙\odot denotes element-wise multiplication. Assume that ht∈R3h_t \in \mathbb{R}^3 and y^t∈R2\hat{y}_t \in \mathbb{R}^2.

Based on the above data, answer the given subquestions.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 25

+2 marksOne correct option

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 (xt∈R2x_t \in \mathbb{R}^2). The GRU uses the following formulas for the hidden state and output at time step tt:

it=σ(Wist−1+Uixt+bi)ot=σ(Wost−1+Uoxt+bo)s~t=tanh⁡(Uxt+W(ot⊙st−1)+b)st=(1−it)⊙st−1+it⊙s~ty^t=Vht+c\begin{aligned} i_t &= \sigma(W_i s_{t-1} + U_i x_t + b_i) \\ o_t &= \sigma(W_o s_{t-1} + U_o x_t + b_o) \\ \tilde{s}_t &= \tanh(Ux_t + W(o_t \odot s_{t-1}) + b) \\ s_t &= (1 - i_t) \odot s_{t-1} + i_t \odot \tilde{s}_t \\ \hat{y}_t &= Vh_t + c \end{aligned}

where ⊙\odot denotes element-wise multiplication. Assume that ht∈R3h_t \in \mathbb{R}^3 and y^t∈R2\hat{y}_t \in \mathbb{R}^2.

Based on the above data, answer the given subquestions.

  1. A

    3 × 2

  2. B

    3 × 4

  3. C

    4 × 3

  4. D

    2 × 4

Show answer

Correct answer

  • B

    3 × 4