Question 1
Consider the following code:
It enables gradient computation
It resets the model parameters every epoch
It clears previously stored gradients
It ensures layers like Dropout and BatchNorm behave correctly during training

The IIT Madras BS Introduction to Deep Learning and Generative AI (Deep Learning and GenAI) Quiz 2 paper sat on 12 Apr 2026, in the January 2026 term: 20 questions for 48 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.
Consider the following code:
It enables gradient computation
It resets the model parameters every epoch
It clears previously stored gradients
It ensures layers like Dropout and BatchNorm behave correctly during training
Correct answer
It ensures layers like Dropout and BatchNorm behave correctly during training
Consider the following code:
What is the spatial size of the output after applying the given pooling code?
2x3
2x2
1x1
1x2
Correct answer
1x1
Which of the following code snippets generates fake images from random noise for training a fully connected GAN network?
Correct answer
Consider the following code:
What will be the final output of the code (z_biased)?
tensor([0.0000, 4.0000])
tensor([1.5000, 4.7000])
tensor([0.5000, 8.7000])
tensor([1.5000, 7.7000])
Correct answer
tensor([1.5000, 7.7000])
Consider the following architecture for a discriminator:
In which of the following lines would you suggest code changes to make the discriminator work as intended?
Line1
Line2
Line3
The code will perfectly work as intended for a discriminator
Correct answer
The code will perfectly work as intended for a discriminator
If Model A has cross-entropy loss = 2.0 and Model B has loss = 1.5, which model has lower perplexity?
Model A
Model B
Both equal
Insufficient Information
Correct answer
Model B
Model A: Exploding, Model B: Near-Stable, Model C: Vanishing
Model A: Exploding, Model B: Exploding, Model C: Vanishing
Model A: Exploding, Model B: Vanishing, Model C: Vanishing
Model A: Near-Stable, Model B: Vanishing, Model C: Vanishing
Model A: Exploding, Model B: Near-Stable, Model C: Near-Stable
Correct answer
Model A: Exploding, Model B: Vanishing, Model C: Vanishing
Consider the following code snippet:
(32, 10, 16)
(10, 32, 16)
(32, 16)
(2, 32, 16)
(2, 32, 10, 16)
Correct answer
(32, 10, 16)
Correct answer: 0.7 (accepted within ±0.05)
Correct answer
You are designing a simple RNN to process sentences of length 10 words for next-word prediction in a chat application.
Each word is represented using a vector of size 6.
The RNN has: Hidden layer size = 4 neurons• Output layer size = 5 neurons• What is the total number of trainable parameters in this RNN including biases?
55
64
69
90
Correct answer
69
Consider the following real-valued functions defined on their natural domains. Select all functions that are convex over their respective domains.
Correct answers
In a GAN training loop, the following function is used before each backward pass:
Suppose a GAN is trained and this function is used in every iteration with learning rate α = 0.01 :
During iteration 1:
The true discriminator gradient (∇θ_D L_D) = 0.6 The true generator gradient (∇θ_G L_G) = 0.5
During iteration 2:
The new discriminator gradient (∇θ_D L_D) = 0.4 The new generator gradient (∇θ_G L_G) = 0.2
What will be the effective parameter update after the second iteration (assume gradients accumulate linearly in PyTorch)?
θ_D ← θ_D - 0.004
θ_D ← θ_D + 0.004
θ_D ← θ_D + 0.010
θ_G ← θ_G - 0.010
θ_G ← θ_G - 0.002
θ_G ← θ_G - 0.007
Correct answers
θ_D ← θ_D - 0.004
θ_G ← θ_G - 0.007
During GAN training, the following code is used to update the discriminator:
However the code doesnt work as intended. Identify the flaws which are preventing to make the code work as intended.
The reset grad method to erase previous gradients needs to be added.
The fake loss should use fake_labels instead of real_labels.
Ratio of the two losses should be taken to compute the final descriminator loss.
Correct answers
The reset grad method to erase previous gradients needs to be added.
The fake loss should use fake_labels instead of real_labels.
Consider the following statements related to optimization in deep learning. Select all statements that are correct.
Step decay, exponential decay, and cosine decay are examples of learning rate scheduling techniques.
Accelerated gradient methods necessarily require the learning rate to decrease over time in order to converge.
Momentum-based methods can improve convergence speed even when the learning rate is kept constant.
Learning rate scheduling methods introduce memory of past gradients into the optimization process.
Learning rate scheduling and accelerated gradient methods can be used together.
Correct answers
Step decay, exponential decay, and cosine decay are examples of learning rate scheduling techniques.
Momentum-based methods can improve convergence speed even when the learning rate is kept constant.
Learning rate scheduling and accelerated gradient methods can be used together.
Consider the following reference sentence:
Reference: machine learning is very fun
Answer the subquestions based on the given data.
Prediction 1: machine learning is fun fun What is the BLEU-1 score for the given prediction?
1.000
0.779
0.800
0.606
Correct answer
0.800
Consider the following reference sentence:
Reference: machine learning is very fun
Answer the subquestions based on the given data.
Prediction 2: machine learning is fun What is the BLEU-1 score for the given prediction?
1.000
0.779
0.800
0.606
Correct answer
0.779
Consider the following PyTorch model:
Answer the subquestions based on the given data.
What is the total number of trainable parameters in the GRU layer?
4,992
4,864
5,184
5,568
Correct answer
5,184
Consider the following PyTorch model:
Answer the subquestions based on the given data.
Correct answer
and the binary cross-entropy loss function.
Based on the above data, answer the given subquestions.
What are the updated values of the weights after the first SGD step?
Correct answer