Quiz Space

Deep Learning Practice · End Term · 22 Dec 2024 · September 2024 term

Question 1: Consider the following code snippets for loading and modi…

Question 1

+5 marksOne correct option

Consider the following code snippets for loading and modifying VGGNet-16 and VGGNet-19 architectures for a classification task with 10 classes:

python
import torch
import torch.nn as nn
from torchvision.models import vgg16, vgg19
# Block A: VGGNet-16 with modified classification head
class VGG16Modified(nn.Module):
def __init__(self, num_classes=10):
super(VGG16Modified, self).__init__()
self.vgg16 = vgg16(pretrained=True)
self.vgg16.classifier[6] = nn.Linear(4096, num_classes)
def forward(self, x):
return self.vgg16(x)
model_a = VGG16Modified()
# Block B: VGGNet-19 with modified classification head
class VGG19Modified(nn.Module):
def __init__(self, num_classes=10):
super(VGG19Modified, self).__init__()
self.vgg19 = vgg19(pretrained=True)
self.vgg19.classifier[6] = nn.Linear(4096, num_classes)
def forward(self, x):
return self.vgg19(x)
model_b = VGG19Modified()
# Block C: Loading VGGNet-16 and freezing feature extraction layers
vgg16_model = vgg16(pretrained=True)
for param in vgg16_model.features.parameters():
param.requires_grad = False
vgg16_model.classifier[6] = nn.Linear(4096, 10)
# Block D: VGGNet-19 with feature extraction layers unfrozen
vgg19_model = vgg19(pretrained=True)
vgg19_model.classifier[6] = nn.Linear(4096, 10)

Which of the following statements are true about the provided blocks?

(a) Block A uses VGGNet-16 and modifies the classification head to support 10 classes.
(b) Block B and Block C both use VGGNet-19 but differ in how feature extraction layers are handled.
(c) Block C freezes the feature extraction layers in VGGNet-16 for transfer learning.
(d) Block D unfreezes feature extraction layers in VGGNet-19, making it trainable end-to-end.

Select the correct options:

  1. A

    (a) and (c)

  2. B

    (b) and (d)

  3. C

    (a), (c), and (d)

  4. D

    All of these

Show answer

Correct answer

  • C

    (a), (c), and (d)

Question 1 of 20 in the IIT Madras BS Deep Learning Practice (Deep Learning Practice) End Term paper sat on 22 Dec 2024, in the September 2024 term (IIT M DEGREE AN EXAM QDB4 22 Dec 2024). It carries 5 marks.

This question was also asked in

More questions from this paper

  1. Q2Figure question
  2. Q3Suppose I have an image of size 227×227. Which of the following code snippets correctly implements a Min Pooling operat…
  3. Q4Consider a black-and-white image of dimension 227×227. Which of the following correctly demonstrates a function to flat…
  4. Q5Which of the following code snippets correctly implements the skip connection in ResNet?
  5. Q6Figure question
  6. Q7The following code snippets represent different blocks in the Fast R-CNN pipeline. Identify the correct arrangement of …
  7. Q8Which of the following code snippets correctly models the loss function in YOLO?
  8. Q9Consider the following predictions and ground truths for a binary classification problem: - True Positives (TP): 30 - F…
  9. Q10How many convolutional layers are there in the original YOLO architecture?
  10. Q11Consider the following code snippet that calculates the Intersection over Union (IoU) for two bounding boxes: What will…
  11. Q12Consider the following code snippets used in a multiscale deep network for single-image depth estimation. Both blocks p…
  12. Q13Which of the following code snippets correctly implements the downsampling operation in a U-Net architecture?
  13. Q14Consider the following predictions and ground truth values:\ Predictions: [3.0,−0.5, 2.0, 7.0] - Ground Truth: [2.5, 0.…
  14. Q15In a stereo vision system, left-right disparity is used to compute depth by comparing\ corresponding points in the left…
  15. Q16What are the primary roles of the generator and discriminator in a Super-Resolution GAN (SRGAN) architecture?
  16. Q17Which of the following code snippets correctly adds gaussian noise to an image?
  17. Q18What are the benefits of using depthwise and pointwise convolutions (as in depthwise separable convolutions) compared t…
  18. Q19Which of the following code snippets correctly implements the generator for a super- resolution GAN (SRGAN) network?
  19. Q20Which of the following are common use cases of super-resolution using SRGAN?