Quiz Space

September 2024 term · Deep Learning · BSCS3004

Deep Learning End Term: 22 December 2024 (September 2024 term)

The IIT Madras BS Deep Learning (Deep Learning) End Term paper sat on 22 Dec 2024, in the September 2024 term: 21 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
21
Marks
50
Duration
180 min
MCQ
10
Numerical
10
MSQ
1

Updated

Official paper: IIT M DEGREE AN EXAM QDB3 22 Dec 2024 · No negative marking.

Question 1

+2 marksOne correct option
  1. A

    5

  2. B

    3

  3. C

    1

  4. D

    0

Show answer

Correct answer

  • A

    5

Question 2

+2 marksOne correct option

You are given a dataset of 10×1010 \times 10 grayscale images. Your goal is to build a 5-class classifier. You have to adopt one of the following two options:

  • Model A: the input is flattened into a 100-dimensional vector, followed by a fully-connected layer with 5 neurons without bias
  • Model B: the input is directly given to a convolutional layer with five 10×1010 \times 10 filters

Suppose you make your choice on the basis of the number of parameters in the models, pAp_A = number of parameters in ModelA, and similarly let pBp_B = number of parameters in ModelB.

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

Correct answer

  • B

Question 3

+2 marksOne correct option

In the context of RNNs, what structural feature of LSTMs helps reduce the impact of vanishing gradients?

  1. A

    Skip connections

  2. B

    Gated mechanisms like forget and input gates

  3. C

    Weight sharing across layers

  4. D

    Use of dropout

Show answer

Correct answer

  • B

    Gated mechanisms like forget and input gates

Question 4

+3 marksOne correct option

As per gradient descent, we should move towards 180 degrees with respect to gradient direction. What will happen if we move between 90 and 180 degrees? Consider the loss function to be convex.

  1. A

    The loss function will increase.

  2. B

    The loss function will decrease, although not to the maximum possible extent.

  3. C

    The loss function will remain the same.

  4. D

    Can’t say. It depends on other parameters of the convex function.

Show answer

Correct answer

  • B

    The loss function will decrease, although not to the maximum possible extent.

Question 5

+3 marksOne correct option

Which of the following statements about the parameter β in RMSProp is correct?

  1. A

    A higher value of β means that past gradients retain more influence on the moving average.

  2. B

    A lower value of β means past gradients have a lesser influence on the moving average.

  3. C

    A higher value of β means the current gradient will have lesser influence than past gradients.

  4. D

    A lower value of β means the current gradient will have higher influence than past gradients.

  5. E

    All of these

Show answer

Correct answer

  • E

    All of these

Question 6

+3 marksOne correct option

Consider a feed-forward neural network containing three inputs and one output. It consists of 50 hidden layers, each with two neurons. The activation function used in all the hidden layers is ReLU, the output layer uses the Sigmoid activation function for binary classification. The network is trained with a binary cross-entropy loss function.
The network architecture is as follows:
- Input layer: 3 nodes
- Hidden layer: 2 nodes each
- Output layer: 1 node
Assume all weights are initialized to 1 and all biases to 0. For an input of [-10, 5, -20], what will be the output of the neural network?

  1. A

    0

  2. B

    1

  3. C

    0.5

  4. D

    0.25

  5. E

    -25

  6. F

    Insufficient information

Show answer

Correct answer

  • C

    0.5

Question 7

+3 marksOne correct option
  1. A

    [0.7, 0.3, 0.6]

  2. B

    [0.4, 0.2, 0.8]

  3. C

    [0.7, 0.6, 0.3]

  4. D

    [0.2, 0.4, 0.8]

Show answer

Correct answer

  • D

    [0.2, 0.4, 0.8]

Question 8

+3 marksOne correct option

In the transformer model, how are self-attention weights calculated for a given token?

  1. A

    By passing the token’s embeddings to softmax function.

  2. B

    Using a feedforward neural network applied to the token’s embeddings.

  3. C

    Through a convolutional operation applied to the token’s neighborhood.

  4. D

    As the dot product between the token’s embeddings and those of all other tokens, followed by a softmax operation.

Show answer

Correct answer

  • D

    As the dot product between the token’s embeddings and those of all other tokens, followed by a softmax operation.

Question 9

+1 markNumerical answer

Consider a sigmoid neuron that takes in an input vector x=[10.51]\mathbf{x} = \begin{bmatrix} 1 \\ 0.5 \\ 1 \end{bmatrix}. The weight vector w\mathbf{w} is initialized to [0.510.5]\begin{bmatrix} 0.5 \\ 1 \\ 0.5 \end{bmatrix} and b=1\mathbf{b} = 1. The output from the sigmoid neuron is

z=wTx+bz = \mathbf{w}^\mathbf{T}\mathbf{x} + \mathbf{b}

y^=11+exp−(z)\hat{\text{y}} = \frac{1}{1 + exp^{-(z)}}

Suppose we use the following loss function

L=12(y−y^)2\mathcal{L} = \frac{1}{2}(y - \hat{y})^2

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 2.5 (accepted within ±0.03)

Question 10

+1 markNumerical answer

Consider a sigmoid neuron that takes in an input vector x=[10.51]\mathbf{x} = \begin{bmatrix} 1 \\ 0.5 \\ 1 \end{bmatrix}. The weight vector w\mathbf{w} is initialized to [0.510.5]\begin{bmatrix} 0.5 \\ 1 \\ 0.5 \end{bmatrix} and b=1\mathbf{b} = 1. The output from the sigmoid neuron is

z=wTx+bz = \mathbf{w}^\mathbf{T}\mathbf{x} + \mathbf{b}

y^=11+exp−(z)\hat{\text{y}} = \frac{1}{1 + exp^{-(z)}}

Suppose we use the following loss function

L=12(y−y^)2\mathcal{L} = \frac{1}{2}(y - \hat{y})^2

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 0.92 (accepted within ±0.03)

Question 11

+2 marksNumerical answer

Consider a sigmoid neuron that takes in an input vector x=[10.51]\mathbf{x} = \begin{bmatrix} 1 \\ 0.5 \\ 1 \end{bmatrix}. The weight vector w\mathbf{w} is initialized to [0.510.5]\begin{bmatrix} 0.5 \\ 1 \\ 0.5 \end{bmatrix} and b=1\mathbf{b} = 1. The output from the sigmoid neuron is

z=wTx+bz = \mathbf{w}^\mathbf{T}\mathbf{x} + \mathbf{b}

y^=11+exp−(z)\hat{\text{y}} = \frac{1}{1 + exp^{-(z)}}

Suppose we use the following loss function

L=12(y−y^)2\mathcal{L} = \frac{1}{2}(y - \hat{y})^2

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 0.39 (accepted within ±0.03)

Question 12

+1 markOne correct option

Which of the following techniques does NOT help prevent a model from overfitting?

  1. A

    Data augmentation

  2. B

    Dropout

  3. C

    Early stopping

  4. D

    None of these

Show answer

Correct answer

  • D

    None of these

Question 13

+3 marksNumerical answer

Suppose you have a vocabulary of 5,000 unique words and you want to train a CBOW model with a window size of 3 (on each side) and with an embedding dimension of 100. How many parameters (weights) will the embedding layer have?

Show answer

Correct answer: 500000

Question 14

+3 marksNumerical answer

Assume that your CBOW model outputs a probability distribution over a vocabulary of 20,000 words for a given context. If the correct target word is word number 150, and the model’s predicted probability for this word is 0.2, calculate the cross-entropy loss for this prediction. (use natural log)

Show answer

Correct answer: 1.6 (accepted within ±0.03)

Question 15

+3 marksNumerical answer

In a Skip-gram model with a window size of 2 (on each side), how many unique pairs of target and context words will be generated for the following sentence:
‘Predicting the future is not magic, it is artificial intelligence’
Note: Ignore the punctuations in your calculation

Show answer

Correct answer: 32

Question 16

+3 marksNumerical answer
Show answer

Correct answer: 126

Question 17

+2 marksNumerical answer

Based on the above data, answer the given subquestions.

With a total of 7 time steps (T = 7), implying prediction for a word of length 6), what is the total count of parameters (including bias) within the network?

Show answer

Correct answer: 33

Question 18

+3 marksOne correct option

Based on the above data, answer the given subquestions.

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

Correct answer

  • D

Question 19

+2 marksNumerical answer

Based on the above data, answer the given subquestions.

If all the parameters (including bias) in the network are initialized to zero, what will be the total loss after 10 time steps (assume that indices start with 1) for the input [0,0,1,0,0,0]T[0,0,1,0,0,0]^T? The ground truth (y∈R5y \in \mathbb{R}^5) for each time step is given by the following sequence [y0,y4,y1,y2,y3,y4,y4,y4,y2,y3][y_0, y_4, y_1, y_2, y_3, y_4, y_4, y_4, y_2, y_3]. Assume the loss to be cross-entropy at each time step. (Use natural log and write the answer correct up to two decimal places.) each yy is one-hot encoder (i.e y0y_0means =[1,0,0,0,0]T= [1,0,0,0,0]^T )

Show answer

Correct answer: 16.1 (accepted within ±0.1)

Question 20

+3 marksOne or more correct options

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

Select all that apply.

  1. A

    The encoder in a Transformer model is responsible for converting the input sequence into a continuous representation that the decoder can then use to generate the output sequence.

  2. B

    The decoder in a Transformer model only attends to the encoder’s output without any form of self-attention on its own inputs.

  3. C

    Multi-head attention in the encoder allows the model to jointly attend to information from different representations at different positions.

  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 in a Transformer model is responsible for converting the input sequence into a continuous representation that the decoder can then use to generate the output sequence.

  • C

    Multi-head attention in the encoder allows the model to jointly attend to information from different representations at different positions.

  • 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 21

+2 marksNumerical answer

Consider a Transformer model with the following specifications for the decoder part: • Input dimension (embedding size): 16
• Number of heads in multi-head attention: 2
• Head output dimension: 8
• Dimension of the feed-forward network: 32
• Number of layers in the decoder: 2
Note: The final output from the attention heads is obtained by concatenating the outputs from the individual heads and hence does not cost any additional parameters.
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: 5120