Quiz Space

Deep Learning Practice · End Term · 13 Apr 2025 · January 2025 term

Question 1: Consider the following code snippet for modifying an Alex…

Question 1

+5 marksOne correct option

Consider the following code snippet for modifying an AlexNet architecture to adapt it for a custom classification task with 10 output classes. Fill in the blank portion with the most appropriate code snippet.

python
import torch
import torch.nn as nn
from torchvision.models import alexnet
class CustomAlexNet(nn.Module):
def __init__(self, num_classes=10):
super(CustomAlexNet, self).__init__()
self.alexnet = alexnet(pretrained=True)
# Blank portion
def forward(self, x):
x = self.alexnet.features(x)
x = self.alexnet.avgpool(x)
x = torch.flatten(x, 1)
x = self.alexnet.classifier(x)
return x
model = CustomAlexNet()

Which of the following code snippets correctly fills the blank portion to modify the AlexNet classifier while preserving the pretrained feature extraction layers?

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

Correct answer

  • A

Question 1 of 20 in the IIT Madras BS Deep Learning Practice (Deep Learning Practice) End Term paper sat on 13 Apr 2025, in the January 2025 term (IIT M FOUNDATION AN EXAM QDF3 13 Apr 2025). It carries 5 marks.

More questions from this paper

  1. Q2An RGB image of size 227 × 227 × 3 is first converted to grayscale and then passed through a 2D Convolutional Neural Ne…
  2. Q3Figure question
  3. Q4Consider a Convolutional Neural Network (CNN) where the feature map after the convolutional and pooling layers has a sh…
  4. Q5In self-supervised depth estimation, left-right consistency loss is often used to ensure that the depth maps from stere…
  5. Q6In the Fast R-CNN object detection pipeline, which of the following steps is NOT part of the preprocessing process?
  6. Q7Consider a deep learning model predicting object bounding box coordinates. The ground truth and predicted coordinates f…
  7. Q8The following code snippets attempt to implement an Inception module in PyTorch. Identify the correct snippet(s):
  8. Q9LAKDNet is designed to enhance feature extraction and knowledge distillation in deep neural networks. Which of the foll…
  9. Q10The following PyTorch code implements a simple Convolutional Neural Network (CNN). However, some of the layers are inco…
  10. Q11SRGAN is a deep learning-based approach for image super-resolution that improves the perceptual quality of upscaled ima…
  11. Q12In the U-Net architecture, downsampling is performed using pooling layers to reduce spatial dimensions while preserving…
  12. Q13Consider the following code snippet, which generates predictions and ground truth for an object detection task: Given t…
  13. Q14Consider the following code snippet, which calculates the F1-score for an object detection task: Given the predictions …
  14. Q15In VGGNet, which part of the architecture contributes the most to memory utilization during training, and which part co…
  15. Q16Which of the following code snippets correctly implement Min Pooling in PyTorch?
  16. Q17In deep convolutional neural networks, 1 x 1 convolutions play a significant role in optimizing computation and feature…
  17. Q18Consider the following PyTorch code snippet for a custom ResNet block. Which of the following options correctly fill in…
  18. Q19Estimating depth from a single image using a multiscale deep neural network presents several challenges. Which of the f…
  19. Q20Monocular depth estimation using a multiscale deep neural network presents several challenges due to the lack of direct…