uiz Space

September 2025 term · Deep Learning for Computer Vision · BSDA5006

Deep Learning for Computer Vision Quiz 2: 23 November 2025 (September 2025 term)

The IIT Madras BS Deep Learning for Computer Vision (Deep Learning for Computer Vision) Quiz 2 paper sat on 23 Nov 2025, in the September 2025 term: 51 questions for 63 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
51
Marks
63
Duration
120 min
MCQ
14
Numerical
34
MSQ
3

Updated

Official paper: IIT M DEGREE AN EXAM QDB2 23 Nov 2025 NEW · 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

    1→iv, 2→ii, 3→i, 4→iii

  2. B

    1→ii, 2→iv, 3→i, 4→iii

  3. C

    1→iv, 2→i, 3→ii, 4→iii

  4. D

    1→iii, 2→ii, 3→iv, 4→i

Show answer

Correct answer

  • A

    1→iv, 2→ii, 3→i, 4→iii

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 the statements is true

Show answer

Correct answer

  • D

    None of the statements is true

Question 7

+2 marksOne correct option

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 ______________

  1. A

    21%

  2. B

    28%

  3. C

    36%

  4. D

    44%

Show answer

Correct answer

  • B

    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 Attention mechanisms can be applied to the bidirectional RNN model, An image captioning network cannot be trained end-to-end even though we are using 2 different modalities to train the network, One of the key components in the vanilla transformer are the recurrent connections that help them to deal with variable input length.

  5. E

    None of these

Show answer

Correct answer

  • A

    Attention mechanisms can be applied to the bidirectional RNN model

Question 9

+2 marksOne correct option

Match the following computer vision tasks to situations:

1) Instance Segmentationi) There are cars in these pixels
2) Classificationii) There are 4 cars in the image
3) Semantic Segmentationiii) There is car in the image
4) Object Detectioniv) There are 4 cars in the image, and here are the pixels with the shape of each of their occurrence
  1. A

    1 → iv, 2 → iii, 3 → ii, 4 → i

  2. B

    1 → ii, 2 → iii, 3 → i, 4 →iv

  3. C

    1 → iv, 2→ iii, 3 → i, 4 → ii

  4. D

    1 → ii, 2 → iv, 3 → iii, 4 → i

Show answer

Correct answer

  • C

    1 → iv, 2→ iii, 3 → i, 4 → ii

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

    1 → iii, 2 → iv, 3 → ii, 4 → i

  2. B

    1 → iv, 2→ i, 3 → iii, 4 →ii

  3. C

    1 → i, 2 → ii, 3 → iii, 4 → iv

  4. D

    1 → i, 2 → iii, 3→ ii, 4 → iv

Show answer

Correct answer

  • B

    1 → iv, 2→ i, 3 → iii, 4 →ii

Question 11

+2 marksOne correct option
  1. A

    1→iii, 2→ii, 3→v, 4→iv,5→i

  2. B

    1→iii, 2→iv, 3→i, 4→ii,5→v

  3. C

    1→i, 2→iii, 3→iv, 4→ii,5→v

  4. D

    1→v, 2→iv, 3→iii, 4→i,5→ii

Show answer

Correct answer

  • D

    1→v, 2→iv, 3→iii, 4→i,5→ii

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

+2 marksNumerical answer
Show answer

Correct answer: 384

Question 16

+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

  • D

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

Question 17

+3 marksOne or more correct options

Which of the following are False:

Select all that apply.

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

Correct answers

  • A
  • C

Question 18

+3 marksOne or more correct options

Which techniques help mitigate exploding/vanishing gradients in RNNs? (Select all that apply.)

Select all that apply.

  1. A

    Gradient clipping

  2. B

    Orthogonal or identity initialization of recurrent weights

  3. C

    Using LSTM/GRU cells

  4. D

    Randomly reversing input sequences as augmentation

Show answer

Correct answers

  • A

    Gradient clipping

  • B

    Orthogonal or identity initialization of recurrent weights

  • C

    Using LSTM/GRU cells

Question 19

+0.5 marksNumerical answer

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 4

Question 20

+0.5 marksNumerical answer

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 6

Question 21

+0.5 marksNumerical answer

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 3

Question 22

+0.5 marksNumerical answer

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 1

Question 23

+1 markNumerical answer

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 2

Question 24

+1 markNumerical answer

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 5

Question 25

+2 marksNumerical answer

Based on the above data, answer the given subquestions.

Number of Parameters:_____________

Show answer

Correct answer: 6422528

Question 26

+2 marksNumerical answer

Based on the above data, answer the given subquestions.

Computational Cost:________________

Show answer

Correct answer: 642252800

Question 27

+1 markNumerical answer

Using the same dimensions specified in the previous question main data, 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 28

+1 markNumerical answer

Using the same dimensions specified in the previous question main data, 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 29

+1 markNumerical answer

Using the same dimensions specified in the previous question main data, 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 30

+1 markNumerical answer

Using the same dimensions specified in the previous question main data, 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 31

+1 markNumerical answer

Based on the above data, answer the given subquestions.

Number of weights in Weight Matrix U1 is:_____________

Show answer

Correct answer: 50

Question 32

+1 markNumerical answer

Based on the above data, answer the given subquestions.

Number of weights in Weight Matrix V1 is:_____________

Show answer

Correct answer: 25

Question 33

+1 markNumerical answer

Based on the above data, answer the given subquestions.

Number of weights in Weight Matrix U2 is:_____________

Show answer

Correct answer: 100

Question 34

+0.5 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 35

+0.5 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 36

+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:

Show answer

Correct answer: 1

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:

Show answer

Correct answer: 0

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:

Show answer

Correct answer: 2

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:

Show answer

Correct answer: 0.245 (accepted within ±0.005)

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:

Show answer

Correct answer: 0.095 (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:

Show answer

Correct answer: 0.67 (accepted within ±0.01)

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:

Show answer

Correct answer: 1.55 (accepted within ±0.05)

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:

Show answer

Correct answer: 2.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 **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}

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 0 (accepted within ±0.01)

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}

Based on the above data, answer the given subquestions.

Show answer

Correct answer: -0.462 (accepted within ±0.001)

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}

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 0.462 (accepted within ±0.001)

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}

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 0.33 (accepted within ±0.01)

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}

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 0.23 (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}

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 0.44 (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}

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 1.5 (accepted within ±0.1)

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}

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 2.5 (accepted within ±0.1)