uiz Space

May 2025 term · Deep Learning for Computer Vision · BSDA5006

Deep Learning for Computer Vision Quiz 2: 3 August 2025 (May 2025 term)

The IIT Madras BS Deep Learning for Computer Vision (Deep Learning for Computer Vision) Quiz 2 paper sat on 3 Aug 2025, in the May 2025 term: 52 questions for 62 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
52
Marks
62
Duration
120 min
MCQ
13
Numerical
36
MSQ
2
Written
1

Updated

Official paper: IIT M IMPROVEMENT AN EXAM QIB2 03 Aug 2025 · No negative marking.

Question 1

+2 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 2

+2 marksOne correct option

Which of the following architectures introduced the ROI pooling layer for extracting fixed-size feature maps from variable-size region proposals?

  1. A

    R-CNN

  2. B

    Fast R-CNN

  3. C

    Faster R-CNN

  4. D

    YOLO

Show answer

Correct answer

  • B

    Fast R-CNN

Question 3

+2 marksOne correct option

Which object detection method first integrated a Region Proposal Network (RPN) to generate region proposals within the detection model?

  1. A

    R-CNN

  2. B

    Fast R-CNN

  3. C

    Faster R-CNN

  4. D

    YOLO

Show answer

Correct answer

  • C

    Faster R-CNN

Question 4

+2 marksOne correct option

Which architecture performs object detection as a single regression problem from image pixels to bounding boxes and class probabilities?

  1. A

    R-CNN

  2. B

    Fast R-CNN

  3. C

    Faster R-CNN

  4. D

    YOLO

Show answer

Correct answer

  • D

    YOLO

Question 5

+2 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 6

+2 marksOne correct option

Consider the following statements P and Q regarding AlexNet and choose the correct option: (P) In AlexNet, a trainable Local Response Normalization Layers were introduced to emulate the competitive nature of real neurons, where highly active neurons suppress the activity of neighboring neurons, creating competition among different kernel outputs.
(Q) In AlexNet, a total of 8 Convolutional layers contain only about 6-7% of the total parameters hence account for the least computation.

  1. A

    Only statement P is true

  2. B

    Only statement Q is true

  3. C

    Both statements are true

  4. D

    None of these statements is true

Show answer

Correct answer

  • D

    None of these statements is true

Question 7

+2 marksNumerical answer

Consider two bounding boxes in an image:
- Box A: top-left at (0, 0), bottom-right at (12, 12) - Box B: top-left at (4, 4), bottom-right at (16, 16) What is the Intersection over Union (IoU) between these two boxes ____________(in %)

Show answer

Correct answer: 28

Question 8

+2 marksOne correct option

Which one of the following statements is True?

  1. A

    Attention mechanisms can be applied to the bidirectional RNN model

  2. B

    An image captioning network cannot be trained end-to-end even though we are using 2 different modalities to train the network

  3. C

    One of the key components in the vanilla transformer are the recurrent connections that help them to deal with variable input length.

  4. D

    All of these.

Show answer

Correct answer

  • A

    Attention mechanisms can be applied to the bidirectional RNN model

Question 9

+2 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 10

+2 marksOne correct option

Match the following:

1) One-to-many RNN architecturei) Sentiment analysis of Netflix reviews
2) Many-to-one RNN architectureii) Convert English sentence to Hindi
3) Many-to-many RNN architecture with equal number of inputs and outputsiii) Named entity recognition
4) Many-to-many RNN architecture with unequal number of inputs and outputs (Encoder and Decoder model)iv) Music generation
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 11

+2 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 12

+2 marksOne correct option

Which of the following techniques help mitigate the vanishing gradient problem in recurrent neural networks?
1. Gradient clipping
2. Use of ReLU activation to preserve gradient flow
3. Use of LSTM units
4. Data augmentation (e.g., reversing input sequence)

  1. A

    1 and 2 only

  2. B

    2 and 3 only

  3. C

    3 and 4 only

  4. D

    1, 2, and 3 only

Show answer

Correct answer

  • B

    2 and 3 only

Question 13

+2 marksOne correct option

Which of the following techniques help mitigate the exploding gradient problem in recurrent neural networks?
1. Gradient clipping
2. Use of Sigmoid activation to prevent gradient growth
3. Use of LSTM units
4. Data augmentation (e.g., reversing input sequence)

  1. A

    1 and 2 only

  2. B

    1 and 3 only

  3. C

    1, 2, and 3

  4. D

    All of these

Show answer

Correct answer

  • B

    1 and 3 only

Question 14

+2 marksOne correct option

Which one of the following statements is false? (Pick the most appropriate one.)

  1. A

    Attention mechanisms cannot be applied to the bidirectional RNN model

  2. B

    An image captioning network cannot be trained end-to-end even though we are using 2 different modalities to train the network

  3. C

    One of the key components in the vanilla transformer is the recurrent connection that help them to deal with variable input length.

  4. D

    All of these

Show answer

Correct answer

  • D

    All of these

Question 15

+3 marksOne or more correct options

Which of the following is true regarding Hard Attention and Soft Attention?

Select all that apply.

  1. A

    Soft Attention is smooth and differentiable

  2. B

    Variance reduction techniques are used to train Soft Attention models

  3. C

    Soft Attention is computationally cheaper than Hard Attention when the source input is large

  4. D

    The inference (test time) overhead is low in Hard Attention when compared to Soft Attention models

Show answer

Correct answers

  • A

    Soft Attention is smooth and differentiable

  • C

    Soft Attention is computationally cheaper than Hard Attention when the source input is large

  • D

    The inference (test time) overhead is low in Hard Attention when compared to Soft Attention models

Question 16

+3 marksOne or more correct options

Which of the following are true:

Select all that apply.

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

Correct answers

  • B
  • D

Question 17

+2 marksNumerical answer

Consider a Faster R-CNN object detection framework, which is being trained with a mini-batch size of 2. The RPN produces 512 proposals, out of which 256 and 128 of them are foreground proposals, corresponding to each image in the mini-batch. For a single mini-batch update, the bounding box regression loss will be computed_____________ times.

Show answer

Correct answer: 384

Question 18

+1 markNumerical answer

Suppose you want to build an encoder-decoder recurrent model with attention. The context vector at time step t is given by:

where αtj refers to the alignment score between the decoder state at time t _____________and the encoder state at time _____________. Note: Please write your answer using variables
Based on the above data, answer the given subquestions.

Decoder state at time t : _______________

Show answer

Correct answer: -1

Question 19

+1 markWritten answer

Suppose you want to build an encoder-decoder recurrent model with attention. The context vector at time step t is given by:

where αtj refers to the alignment score between the decoder state at time t _____________and the encoder state at time _____________. Note: Please write your answer using variables
Based on the above data, answer the given subquestions.

Encoder state at time: _______________

Show answer

Correct answer: j

Question 20

+0.66 marksNumerical answer

Consider a Gated Recurrent Unit (GRU) cell at time step ’t’.

For each of the entities in the given subquestions, enter the appropriate number from the figure that corresponds to it:
Based on the above data, answer the given subquestions.

Hidden state ht−1______________

Show answer

Correct answer: 4

Question 21

+0.66 marksNumerical answer

Consider a Gated Recurrent Unit (GRU) cell at time step ’t’.

For each of the entities in the given subquestions, enter the appropriate number from the figure that corresponds to it:
Based on the above data, answer the given subquestions.

Hidden state ht_____________

Show answer

Correct answer: 6

Question 22

+0.67 marksNumerical answer

Consider a Gated Recurrent Unit (GRU) cell at time step ’t’.

For each of the entities in the given subquestions, enter the appropriate number from the figure that corresponds to it:
Based on the above data, answer the given subquestions.

Current Input xt________________

Show answer

Correct answer: 3

Question 23

+0.67 marksNumerical answer

Consider a Gated Recurrent Unit (GRU) cell at time step ’t’.

For each of the entities in the given subquestions, enter the appropriate number from the figure that corresponds to it:
Based on the above data, answer the given subquestions.

Update gate zt_______________

Show answer

Correct answer: 1

Question 24

+0.67 marksNumerical answer

Consider a Gated Recurrent Unit (GRU) cell at time step ’t’.

For each of the entities in the given subquestions, enter the appropriate number from the figure that corresponds to it:
Based on the above data, answer the given subquestions.

Reset gate rt ______________

Show answer

Correct answer: 2

Question 25

+0.67 marksNumerical answer

Consider a Gated Recurrent Unit (GRU) cell at time step ’t’.

For each of the entities in the given subquestions, enter the appropriate number from the figure that corresponds to it:
Based on the above data, answer the given subquestions.

New hidden state content eh____________

Show answer

Correct answer: 5

Question 26

+2 marksNumerical answer

Let input have size Df × Df × M where Df = 10 and M = 256 and output feature map (after passing input through conv layer) has Df × Df × N size where N = 512. Assume padded convolution. Let width of the square kernel in conv layer be k where k = 7 (Ignore the bias term in the calculation). Calculate the number of parameters and computational cost for this convolution layer. Based on the above data, answer the given subquestions.

Number of Parameters:_____________

Show answer

Correct answer: 6422528

Question 27

+2 marksNumerical answer

Let input have size Df × Df × M where Df = 10 and M = 256 and output feature map (after passing input through conv layer) has Df × Df × N size where N = 512. Assume padded convolution. Let width of the square kernel in conv layer be k where k = 7 (Ignore the bias term in the calculation). Calculate the number of parameters and computational cost for this convolution layer. Based on the above data, answer the given subquestions.

Computational Cost:___________________

Show answer

Correct answer: 642252800

Question 28

+1 markNumerical answer

Let input have size Df × Df × M where Df = 10 and M = 256 and output feature map (after passing input through conv layer) has Df × Df × N size where N = 512. Assume padded convolution. Let width of the square kernel in conv layer be k where k = 7 (Ignore the bias term in the calculation), calculate the number of parameters and computational cost, but make use of Depthwise Seperable convolution and pointwise convolution instead of standard convolution. Based on the above data, answer the given subquestions.

Number of parameters for depthwise seperable convolution:_______________

Show answer

Correct answer: 12544

Question 29

+1 markNumerical answer

Let input have size Df × Df × M where Df = 10 and M = 256 and output feature map (after passing input through conv layer) has Df × Df × N size where N = 512. Assume padded convolution. Let width of the square kernel in conv layer be k where k = 7 (Ignore the bias term in the calculation), calculate the number of parameters and computational cost, but make use of Depthwise Seperable convolution and pointwise convolution instead of standard convolution. Based on the above data, answer the given subquestions.

Computational Cost for depthwise seperable convolution:____________________

Show answer

Correct answer: 1254400

Question 30

+1 markNumerical answer

Let input have size Df × Df × M where Df = 10 and M = 256 and output feature map (after passing input through conv layer) has Df × Df × N size where N = 512. Assume padded convolution. Let width of the square kernel in conv layer be k where k = 7 (Ignore the bias term in the calculation), calculate the number of parameters and computational cost, but make use of Depthwise Seperable convolution and pointwise convolution instead of standard convolution. Based on the above data, answer the given subquestions.

Number of parameters for pointwise convolution:___________________

Show answer

Correct answer: 131072

Question 31

+1 markNumerical answer

Let input have size Df × Df × M where Df = 10 and M = 256 and output feature map (after passing input through conv layer) has Df × Df × N size where N = 512. Assume padded convolution. Let width of the square kernel in conv layer be k where k = 7 (Ignore the bias term in the calculation), calculate the number of parameters and computational cost, but make use of Depthwise Seperable convolution and pointwise convolution instead of standard convolution. Based on the above data, answer the given subquestions.

Computational cost for pointwise convolution:__________________

Show answer

Correct answer: 13107200

Question 32

+0.8 marksNumerical answer

Based on the above data, answer the given subquestions.

Number of weights in Weight Matrix U1 is:______________

Show answer

Correct answer: 50

Question 33

+0.8 marksNumerical answer

Based on the above data, answer the given subquestions.

Number of weights in Weight Matrix V1 is:______________

Show answer

Correct answer: 25

Question 34

+0.8 marksNumerical answer

Based on the above data, answer the given subquestions.

Number of weights in Weight Matrix U2 is:__________________

Show answer

Correct answer: 100

Question 35

+0.8 marksNumerical answer

Based on the above data, answer the given subquestions.

Number of weights in Weight Matrix V2 is:___________________

Show answer

Correct answer: 400

Question 36

+0.8 marksNumerical answer

Based on the above data, answer the given subquestions.

Number of weights in Weight Matrix W is:_______________

Show answer

Correct answer: 800

Question 37

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **dot-product attention**, where the attention score is computed as:

etj=st⊤hjandαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = s_t^\top h_j \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Note: Use approximate values of exponential exp⁡(1)≈2.72\exp(1) \approx 2.72, exp⁡(2)≈7.39\exp(2) \approx 7.39, etc.

Answer the given subquestions:

e21: _________________

Show answer

Correct answer: 1

Question 38

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **dot-product attention**, where the attention score is computed as:

etj=st⊤hjandαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = s_t^\top h_j \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Note: Use approximate values of exponential exp⁡(1)≈2.72\exp(1) \approx 2.72, exp⁡(2)≈7.39\exp(2) \approx 7.39, etc.

Answer the given subquestions:

e22: _________________

Show answer

Correct answer: 0

Question 39

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **dot-product attention**, where the attention score is computed as:

etj=st⊤hjandαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = s_t^\top h_j \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Note: Use approximate values of exponential exp⁡(1)≈2.72\exp(1) \approx 2.72, exp⁡(2)≈7.39\exp(2) \approx 7.39, etc.

Answer the given subquestions:

e23: _________________

Show answer

Correct answer: 2

Question 40

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **dot-product attention**, where the attention score is computed as:

etj=st⊤hjandαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = s_t^\top h_j \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Note: Use approximate values of exponential exp⁡(1)≈2.72\exp(1) \approx 2.72, exp⁡(2)≈7.39\exp(2) \approx 7.39, etc.

Answer the given subquestions:

α21: _________________

Show answer

Correct answer: 0.245 (accepted within ±0.005)

Question 41

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **dot-product attention**, where the attention score is computed as:

etj=st⊤hjandαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = s_t^\top h_j \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Note: Use approximate values of exponential exp⁡(1)≈2.72\exp(1) \approx 2.72, exp⁡(2)≈7.39\exp(2) \approx 7.39, etc.

Answer the given subquestions:

α22: _________________

Show answer

Correct answer: 0.095 (accepted within ±0.005)

Question 42

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **dot-product attention**, where the attention score is computed as:

etj=st⊤hjandαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = s_t^\top h_j \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Note: Use approximate values of exponential exp⁡(1)≈2.72\exp(1) \approx 2.72, exp⁡(2)≈7.39\exp(2) \approx 7.39, etc.

Answer the given subquestions:

α23: _________________

Show answer

Correct answer: 0.67 (accepted within ±0.01)

Question 43

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **dot-product attention**, where the attention score is computed as:

etj=st⊤hjandαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = s_t^\top h_j \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Note: Use approximate values of exponential exp⁡(1)≈2.72\exp(1) \approx 2.72, exp⁡(2)≈7.39\exp(2) \approx 7.39, etc.

Answer the given subquestions:

c21: _________________

Show answer

Correct answer: 1.55 (accepted within ±0.05)

Question 44

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **dot-product attention**, where the attention score is computed as:

etj=st⊤hjandαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = s_t^\top h_j \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Note: Use approximate values of exponential exp⁡(1)≈2.72\exp(1) \approx 2.72, exp⁡(2)≈7.39\exp(2) \approx 7.39, etc.

Answer the given subquestions:

c22: _________________

Show answer

Correct answer: 2.55 (accepted within ±0.05)

Question 45

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **additive attention**, where the alignment score is computed as:

etj=va⊤tanh⁡(W1st+W2hj)andαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = v_a^\top \tanh(W_1 s_t + W_2 h_j) \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

W1=[1001],W2=[1111],va=[1−1]W_1 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \quad W_2 = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}, \quad v_a = \begin{bmatrix} 1 \\ -1 \end{bmatrix}

Hint: Approximate values of tanh⁡(x)\tanh(x): tanh⁡(0)=0\tanh(0) = 0, tanh⁡(1)≈0.76\tanh(1) \approx 0.76, tanh⁡(2)≈0.96\tanh(2) \approx 0.96, tanh⁡(3)≈0.995\tanh(3) \approx 0.995, tanh⁡(4)≈0.9993\tanh(4) \approx 0.9993, tanh⁡(5)≈0.9999\tanh(5) \approx 0.9999, tanh⁡(6)≈0.99999\tanh(6) \approx 0.99999

Answer the given subquestions:

e21:_________________

Show answer

Correct answer: 0 (accepted within ±0.01)

Question 46

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **additive attention**, where the alignment score is computed as:

etj=va⊤tanh⁡(W1st+W2hj)andαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = v_a^\top \tanh(W_1 s_t + W_2 h_j) \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

W1=[1001],W2=[1111],va=[1−1]W_1 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \quad W_2 = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}, \quad v_a = \begin{bmatrix} 1 \\ -1 \end{bmatrix}

Hint: Approximate values of tanh⁡(x)\tanh(x): tanh⁡(0)=0\tanh(0) = 0, tanh⁡(1)≈0.76\tanh(1) \approx 0.76, tanh⁡(2)≈0.96\tanh(2) \approx 0.96, tanh⁡(3)≈0.995\tanh(3) \approx 0.995, tanh⁡(4)≈0.9993\tanh(4) \approx 0.9993, tanh⁡(5)≈0.9999\tanh(5) \approx 0.9999, tanh⁡(6)≈0.99999\tanh(6) \approx 0.99999

Answer the given subquestions:

e22:_________________

Show answer

Correct answer: -0.462

Question 47

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **additive attention**, where the alignment score is computed as:

etj=va⊤tanh⁡(W1st+W2hj)andαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = v_a^\top \tanh(W_1 s_t + W_2 h_j) \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

W1=[1001],W2=[1111],va=[1−1]W_1 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \quad W_2 = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}, \quad v_a = \begin{bmatrix} 1 \\ -1 \end{bmatrix}

Hint: Approximate values of tanh⁡(x)\tanh(x): tanh⁡(0)=0\tanh(0) = 0, tanh⁡(1)≈0.76\tanh(1) \approx 0.76, tanh⁡(2)≈0.96\tanh(2) \approx 0.96, tanh⁡(3)≈0.995\tanh(3) \approx 0.995, tanh⁡(4)≈0.9993\tanh(4) \approx 0.9993, tanh⁡(5)≈0.9999\tanh(5) \approx 0.9999, tanh⁡(6)≈0.99999\tanh(6) \approx 0.99999

Answer the given subquestions:

e23:_________________

Show answer

Correct answer: 0.462

Question 48

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **additive attention**, where the alignment score is computed as:

etj=va⊤tanh⁡(W1st+W2hj)andαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = v_a^\top \tanh(W_1 s_t + W_2 h_j) \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

W1=[1001],W2=[1111],va=[1−1]W_1 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \quad W_2 = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}, \quad v_a = \begin{bmatrix} 1 \\ -1 \end{bmatrix}

Hint: Approximate values of tanh⁡(x)\tanh(x): tanh⁡(0)=0\tanh(0) = 0, tanh⁡(1)≈0.76\tanh(1) \approx 0.76, tanh⁡(2)≈0.96\tanh(2) \approx 0.96, tanh⁡(3)≈0.995\tanh(3) \approx 0.995, tanh⁡(4)≈0.9993\tanh(4) \approx 0.9993, tanh⁡(5)≈0.9999\tanh(5) \approx 0.9999, tanh⁡(6)≈0.99999\tanh(6) \approx 0.99999

Answer the given subquestions:

α21:_________________

Show answer

Correct answer: 0.33 (accepted within ±0.01)

Question 49

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **additive attention**, where the alignment score is computed as:

etj=va⊤tanh⁡(W1st+W2hj)andαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = v_a^\top \tanh(W_1 s_t + W_2 h_j) \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

W1=[1001],W2=[1111],va=[1−1]W_1 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \quad W_2 = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}, \quad v_a = \begin{bmatrix} 1 \\ -1 \end{bmatrix}

Hint: Approximate values of tanh⁡(x)\tanh(x): tanh⁡(0)=0\tanh(0) = 0, tanh⁡(1)≈0.76\tanh(1) \approx 0.76, tanh⁡(2)≈0.96\tanh(2) \approx 0.96, tanh⁡(3)≈0.995\tanh(3) \approx 0.995, tanh⁡(4)≈0.9993\tanh(4) \approx 0.9993, tanh⁡(5)≈0.9999\tanh(5) \approx 0.9999, tanh⁡(6)≈0.99999\tanh(6) \approx 0.99999

Answer the given subquestions:

α22:_________________

Show answer

Correct answer: 0.23 (accepted within ±0.01)

Question 50

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **additive attention**, where the alignment score is computed as:

etj=va⊤tanh⁡(W1st+W2hj)andαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = v_a^\top \tanh(W_1 s_t + W_2 h_j) \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

W1=[1001],W2=[1111],va=[1−1]W_1 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \quad W_2 = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}, \quad v_a = \begin{bmatrix} 1 \\ -1 \end{bmatrix}

Hint: Approximate values of tanh⁡(x)\tanh(x): tanh⁡(0)=0\tanh(0) = 0, tanh⁡(1)≈0.76\tanh(1) \approx 0.76, tanh⁡(2)≈0.96\tanh(2) \approx 0.96, tanh⁡(3)≈0.995\tanh(3) \approx 0.995, tanh⁡(4)≈0.9993\tanh(4) \approx 0.9993, tanh⁡(5)≈0.9999\tanh(5) \approx 0.9999, tanh⁡(6)≈0.99999\tanh(6) \approx 0.99999

Answer the given subquestions:

α23:_________________

Show answer

Correct answer: 0.44 (accepted within ±0.01)

Question 51

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **additive attention**, where the alignment score is computed as:

etj=va⊤tanh⁡(W1st+W2hj)andαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = v_a^\top \tanh(W_1 s_t + W_2 h_j) \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

W1=[1001],W2=[1111],va=[1−1]W_1 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \quad W_2 = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}, \quad v_a = \begin{bmatrix} 1 \\ -1 \end{bmatrix}

Hint: Approximate values of tanh⁡(x)\tanh(x): tanh⁡(0)=0\tanh(0) = 0, tanh⁡(1)≈0.76\tanh(1) \approx 0.76, tanh⁡(2)≈0.96\tanh(2) \approx 0.96, tanh⁡(3)≈0.995\tanh(3) \approx 0.995, tanh⁡(4)≈0.9993\tanh(4) \approx 0.9993, tanh⁡(5)≈0.9999\tanh(5) \approx 0.9999, tanh⁡(6)≈0.99999\tanh(6) \approx 0.99999

Answer the given subquestions:

c21:_________________

Show answer

Correct answer: 1.5 (accepted within ±0.1)

Question 52

+0.5 marksNumerical answer

You are given the encoder hidden states h1,h2,h3∈R2h_1, h_2, h_3 \in \mathbb{R}^2 and the decoder hidden state s2∈R2s_2 \in \mathbb{R}^2 at time step t=2t = 2.

Use **additive attention**, where the alignment score is computed as:

etj=va⊤tanh⁡(W1st+W2hj)andαtj=exp⁡(etj)∑k=13exp⁡(etk)e_{tj} = v_a^\top \tanh(W_1 s_t + W_2 h_j) \quad \text{and} \quad \alpha_{tj} = \frac{\exp(e_{tj})}{\sum_{k=1}^{3} \exp(e_{tk})}

The context vector is then computed as:

ct=∑j=13αtjhjc_t = \sum_{j=1}^{3} \alpha_{tj} h_j

Use the following values:

s2=[10],h1=[12],h2=[01],h3=[23]s_2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad h_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \quad h_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad h_3 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

W1=[1001],W2=[1111],va=[1−1]W_1 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \quad W_2 = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}, \quad v_a = \begin{bmatrix} 1 \\ -1 \end{bmatrix}

Hint: Approximate values of tanh⁡(x)\tanh(x): tanh⁡(0)=0\tanh(0) = 0, tanh⁡(1)≈0.76\tanh(1) \approx 0.76, tanh⁡(2)≈0.96\tanh(2) \approx 0.96, tanh⁡(3)≈0.995\tanh(3) \approx 0.995, tanh⁡(4)≈0.9993\tanh(4) \approx 0.9993, tanh⁡(5)≈0.9999\tanh(5) \approx 0.9999, tanh⁡(6)≈0.99999\tanh(6) \approx 0.99999

Answer the given subquestions:

c22:_________________

Show answer

Correct answer: 2.5 (accepted within ±0.1)