uiz Space

September 2025 term · Introduction to Deep Learning and Generative AI · BSDA2001

Introduction to Deep Learning and Generative AI Quiz 2: 23 November 2025 (September 2025 term)

The IIT Madras BS Introduction to Deep Learning and Generative AI (Deep Learning and GenAI) Quiz 2 paper sat on 23 Nov 2025, in the September 2025 term: 25 questions for 50 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
25
Marks
50
Duration
120 min
MCQ
17
Numerical
7
MSQ
1

Updated

Official paper: IIT M DIPLOMA AN EXAM QDD2 23 Nov 2025 NEW · No negative marking.

Question 1

+2 marksOne correct option

You have a tensor x = torch.tensor([1, 2, 3, 4]).

You perform

python
stacked_x_dim0 = torch.stack([x, x, x], dim=0)

And

python
stacked_x_dim1 = torch.stack([x, x, x], dim=1)

What will be the shapes of stacked_x_dim0 and stacked_x_dim1 respectively?

  1. A

    stacked_x_dim0: [3, 3], stacked_x_dim1: [4, 4]

  2. B

    stacked_x_dim0: [4, 3], stacked_x_dim1: [3, 4]

  3. C

    stacked_x_dim0: [3, 4], stacked_x_dim1: [4, 3]

  4. D

    stacked_x_dim0: [4, 4], stacked_x_dim1: [3, 3]

Show answer

Correct answer

  • C

    stacked_x_dim0: [3, 4], stacked_x_dim1: [4, 3]

Question 2

+1 markOne correct option

You have a PyTorch tensor

python
gpu_tensor = torch.tensor([1, 2, 3]).to('cuda')

residing on the GPU. You then attempt to convert it directly to a NumPy array using

python
numpy_array = gpu_tensor.numpy()

What will be the outcome of this operation?

  1. A

    It will successfully convert gpu_tensor to a NumPy array on the CPU.

  2. B

    It will successfully convert gpu_tensor to a NumPy array that also resides on the GPU.

  3. C

    It will raise a RuntimeError because NumPy arrays cannot directly operate on GPU memory.

  4. D

    It will create a view of the gpu_tensor on the CPU without copying data.

  5. E

    The numpy() method is not available for GPU tensors.

Show answer

Correct answer

  • C

    It will raise a RuntimeError because NumPy arrays cannot directly operate on GPU memory.

Question 3

+1 markOne correct option

The Huber Loss function is introduced as a robust alternative to Mean Squared Error (MSE) and Mean Absolute Error (MAE). What is the primary characteristic of Huber Loss that makes it robust to outliers?

  1. A

    It always produces a gradient of zero for all errors, preventing large updates.

  2. B

    It exclusively uses a quadratic penalty, but only for errors exactly at the threshold.

  3. C

    It transitions from a quadratic loss for small errors to a linear loss for large errors, thereby down-weighting the impact of outliers.

  4. D

    It entirely ignores errors beyond a certain delta, considering them irrelevant.

  5. E

    It applies a logarithmic transformation to all error values before computing the loss.

Show answer

Correct answer

  • C

    It transitions from a quadratic loss for small errors to a linear loss for large errors, thereby down-weighting the impact of outliers.

Question 4

+3 marksNumerical answer

A deep learning model contains a stack of three consecutive 3x3 convolutional layers, each with a stride of 1and sufficient padding to preserve spatial dimensions. What is the side length of the effective receptive field of a neuron in the third layer with respect to the input?

Show answer

Correct answer: 7

Question 5

+2 marksNumerical answer
Show answer

Correct answer: 348

Question 6

+1 markOne correct option

The Momentum optimizer helps overcome which limitation of vanilla Gradient Descent?

  1. A

    Slow convergence near the minimum due to large learning rate.

  2. B

    Zig-zag oscillations in narrow valleys due to gradient directions changing frequently.

  3. C

    Vanishing gradients caused by activation functions.

  4. D

    Overfitting due to excessive updates.

Show answer

Correct answer

  • B

    Zig-zag oscillations in narrow valleys due to gradient directions changing frequently.

Question 7

+4 marksNumerical answer

Consider the RMSProp optimizer update rule:

vt=βvt−1+(1−β)(∇wt)2v_t = \beta v_{t-1} + (1 - \beta)(\nabla w_t)^2

The algorithm runs for 10 iterations (t=0,1,2,…,9t = 0, 1, 2, \ldots, 9).

After 10 iterations, what multiplicative weight is applied to the very first gradient term (∇w0)2(\nabla w_0)^2 in the accumulated history v9v_9?

Assume v−1=0v_{-1} = 0 and β=0.9\beta = 0.9.

Enter the answer correct up to 3 decimal places.

Show answer

Correct answer: 0.035 (accepted within ±0.005)

Question 8

+2 marksOne correct option

You are given two loss functions. Your task is to identify their nature using the second derivative test.

Function A:

A(w)=w2−6w+10A(w) = w^2 - 6w + 10

Function B:

B(w)=ew+e−wB(w) = e^w + e^{-w}

Which statement correctly identifies the functions and provides the correct mathematical justification?

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

Correct answer

  • C

Question 9

+1 markOne correct option

What happens if the latent space in a GAN has too few dimensions for the task complexity?

  1. A

    Training becomes faster and results improve.

  2. B

    The discriminator becomes too powerful.

  3. C

    The generator memorizes all training images.

  4. D

    Generated images lack diversity and may look similar

Show answer

Correct answer

  • D

    Generated images lack diversity and may look similar

Question 10

+2 marksOne correct option

At Nash Equilibrium in a perfectly trained GAN, what is the expected output of the discriminator D(G(z)) for a generated sample?

  1. A

    0

  2. B

    0.25

  3. C

    0.5

  4. D

    1

Show answer

Correct answer

  • C

    0.5

Question 11

+2 marksOne correct option

A student is trying to write the Generator training loop and is confused about the order of operations. Their code is:

python
# --- Training the Generator ---
# 1. Generate fakes and get D's output
z = torch.randn(batch_size, latent_size).to(device)
fake_images = G(z)
d_out_fake = D(fake_images)
# 2. Calculate loss
g_loss = criterion(d_out_fake, real_labels)
# 3. Update weights
G_optimizer.step() # Line 3a
g_loss.backward() # Line 3b
G.zero_grad() # Line 3c

This code is completely broken. What is the correct, functional order for lines 3a, 3b, and 3c?

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

Correct answer

  • C

Question 12

+2 marksOne correct option

You've been training your GAN for 100 epochs. You notice two things:

  1. The Generator loss (g_loss) is very low and stable, and the Discriminator loss (d_loss) is high and stable.
  2. When you inspect the saved images, the Generator is producing the exact same (or very similar) image of a single "ankle boot" for every latent vector z you input.

What is this classic GAN failure mode called?

  1. A

    Vanishing Gradients

  2. B

    Mode Collapse

  3. C

    Overfitting

  4. D

    Discriminator Saturation

Show answer

Correct answer

  • B

    Mode Collapse

Question 13

+2 marksOne or more correct options

Select all that apply.

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

Correct answers

  • A
  • C
  • E

Question 14

+1 markNumerical answer
Show answer

Correct answer: 5

Question 15

+2 marksOne correct option
  1. A

    (10,8,32)

  2. B

    (10,28,8)

  3. C

    (28,10,8)

  4. D

    (8,10,28)

Show answer

Correct answer

  • C

    (28,10,8)

Question 16

+3 marksNumerical answer

Consider that the following paragraph is used as the input to train a sequence language model:

"this is a great sunny day the advantage of being a sunny day is that we can indulge in many outdoor sports and activities i am not wrong when i say that it is a great sunny morning"

(Ignore the double quotes in the vocab)

  • No smoothing is applied.
  • Tokenization is done by splitting on spaces.
  • If a context does not appear, its conditional probability is zero.

What is the probability the model generates the following sequence ?

"a great sunny morning"

(Answer upto 3 decimals)

Show answer

Correct answer: 0.025 (accepted within ±0.005)

Question 17

+2 marksOne correct option
  1. A

    8.58

  2. B

    2.15

  3. C

    0.72

  4. D

    4.71

Show answer

Correct answer

  • A

    8.58

Question 18

+3 marksOne correct option

You are performing Beam Search with K=2 to generate a sequence.

Step 1: The model predicts probabilities for the first word:

text
"A": 0.5
"The": 0.4
"It": 0.1

Step 2: You expand the K=2 hypotheses ("A" and "The").

Given "A", P(next word): {"dog": 0.6, "cat": 0.3, ...}

Given "The", P(next word): {"dog": 0.5, "cat": 0.4, ...}

After Step 2, what are the sequences (beams) that you will keep for Step 3?

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

Correct answer

  • C

Question 19

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

Correct answer

  • C

Question 20

+1 markOne correct option
  1. A

    It specifies how many epochs with no improvement in the monitored metric are tolerated beforereducing the learning rate.

  2. B

    It automatically restarts training after the learning rate is reduced.

  3. C

    It determines the number of epochs required for validation loss to reach the minimum.

  4. D

    It defines how many epochs the learning rate should remain frozen after being reduced.

Show answer

Correct answer

  • A

    It specifies how many epochs with no improvement in the monitored metric are tolerated beforereducing the learning rate.

Question 21

+4 marksNumerical answer

Given the update rule for Adagrad

vt=vt−1+(∇wt)2wt+1=wt−ηvt+ϵ∇wt\begin{aligned} v_t &= v_{t-1} + (\nabla w_t)^2 \\ w_{t+1} &= w_t - \frac{\eta}{\sqrt{v_t + \epsilon}} \nabla w_t \end{aligned}

where v−1v_{-1} and ϵ\epsilon are set to 00. The gradient for the function of single variable is 11 at any point. The effective learning rate at timestamp tt is ηvt\frac{\eta}{\sqrt{v_t}}.

β\beta lies between 00 and 11.

Note: w0→w1w_0 \to w_1 is the first update, w1→w2w_1 \to w_2 is the second update and so on.

What is the effective learning rate for the parameter while using Adagrad at the ninth update step (to get w9w_9) if the initial learning rate is 11? Round your answer to 2 decimal places.

Show answer

Correct answer: 0.35 (accepted within ±0.05)

Question 22

+1 markOne correct option

In an LSTM (Long Short-Term Memory) network, which pair of components correctly represents the short-term and long-term memory respectively?

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

Correct answer

  • B

Question 23

+2 marksOne correct option

The LSTM (Long Short-Term Memory) network uses several gates to control information flow. Here are the key equations with a placeholder [?] for a missing operator:

Gate Computations:

  1. Forget gate: ft=σ(Wf⋅[ht−1,xt]+bf)f_t = \sigma(W_f \cdot [h_{t-1}, x_t] + b_f)
  2. Input gate: it=σ(Wi⋅[ht−1,xt]+bi)i_t = \sigma(W_i \cdot [h_{t-1}, x_t] + b_i)
  3. Candidate values: c~t=tanh(Wc⋅[ht−1,xt]+bc)\tilde{c}_t = tanh(W_c \cdot [h_{t-1}, x_t] + b_c)
  4. Output gate: ot=σ(Wo⋅[ht−1,xt]+bo)o_t = \sigma(W_o \cdot [h_{t-1}, x_t] + b_o)

Memory Update Equations (with placeholder):

  1. Cell state update: ct=ft[?]ct−1+it[?]c~tc_t = f_t[?]c_{t-1} + i_t[?]\tilde{c}_t
  2. Hidden state update: ht=ot[?]tanh(ct)h_t = o_t[?]tanh(c_t)

Which operator should replace [?] in the LSTM memory update equations (5 and 6) above?

  1. A

    Matrix multiplication (·)

  2. B

    Element-wise multiplication (⊙)

  3. C

    Cross product (x)

  4. D

    Element-wise addition (+)

Show answer

Correct answer

  • B

    Element-wise multiplication (⊙)

Question 24

+2 marksOne correct option

You are training an RNN-based text classification model with the following three sequences:

text
Sequence 1: "I love deep learning" → 4 tokens
Sequence 2: "NLP is great" → 3 tokens
Sequence 3: "AI" → 1 token

Under which training scenario is padding NOT strictly required for processing these sequences?

  1. A

    Using mini-batch gradient descent with batch size = 32

  2. B

    Using stochastic gradient descent (SGD) with batch size = 1

  3. C

    Using batch gradient descent processing all samples at once

  4. D

    Using mini-batch gradient descent with batch size = 16

Show answer

Correct answer

  • B

    Using stochastic gradient descent (SGD) with batch size = 1

Question 25

+2 marksNumerical answer

Consider the following modified implementation of an RNN.

python
self.rnn = nn.RNN(embedding_dim, hidden_dim, n_layers,
dropout=drop_prob, batch_first=True)
self.dropout = nn.Dropout(0.3) #line1
self.fc = nn.Linear(hidden_dim, output_size)

What will be the percentage reduction in the rnn parameters due to applying line one? (Answer upto one decimal)

Show answer

Correct answer: 0 (accepted within ±0.0001)