uiz Space

May 2025 term · Deep Learning Practice · BSDA5013

Deep Learning Practice Quiz 2: 3 August 2025 (May 2025 term)

The IIT Madras BS Deep Learning Practice (Deep Learning Practice) Quiz 2 paper sat on 3 Aug 2025, in the May 2025 term: 11 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
11
Marks
50
Duration
120 min
MCQ
4
MSQ
4
Numerical
3

Updated

Official paper: IIT M IMPROVEMENT AN EXAM QIM2 03 Aug 2025 · No negative marking.

Question 1

+3 marksOne correct option

In a speaker diarization pipeline that uses Whisper for transcription and an embedding model for speaker identification,you observe that one speaker's segments are consistently broken into multiple smaller segments, each assigned a different speaker label (e.g., SPEAKER 1, SPEAKER 3, SPEAKER 5). The transcribed text for this speaker is perfectly accurate. What is the MOST likely cause of this specific issue?

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

Correct answer

  • D

Question 2

+3 marksOne correct option

Consider the following code snippet for using a pretrained Wav2Vec2 model:

python
from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
import torch
processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-base-960h")
model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-base-960h")
# Pretend this is audio data
input_values = torch.randn(16000) # 1 second of fake audio
# Forward pass
logits = model(input_values).logits

What is the primary issue in the above code?

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

Correct answer

  • C

Question 3

+5 marksOne or more correct options

Which statements accurately describe the roles and differences of the data collators used in the ASR and TTS training scripts?

Select all that apply.

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

Correct answers

  • A
  • C
  • D

Question 4

+5 marksOne or more correct options

Select all that apply.

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

Correct answers

  • A
  • B
  • C
  • E

Question 5

+5 marksNumerical answer

You are calculating the Word Error Rate (WER) for an ASR model's prediction. Given the following ground truth and prediction, what is the resulting WER? Provide the answer rounded to two decimal places.

python
from jiwer import wer
ground_truth = "i like to eat apples and bananas"
prediction = "i like eating apple and banana"
error = wer(ground_truth, prediction)
print(error)
Show answer

Correct answer: 0.57 (accepted within ±0.02)

Question 6

+5 marksNumerical answer
Show answer

Correct answer: 1536000

Question 7

+4 marksOne correct option

Consider the following code snippet that processes a raw audio sample first with a Wav2Vec2Processor and then with a Wav2Vec2Model.

python
from transformers import Wav2Vec2Processor, Wav2Vec2Model
import torch
processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-base-960h")
model = Wav2Vec2Model.from_pretrained("facebook/wav2vec2-base-960h")
# A 1-second audio sample at 16kHz
sample_audio = torch.randn(1, 16000)
# Method 1: Processing the audio
inputs_processed = processor(sample_audio, sampling_rate=16000, return_tensors="pt")
# The shape of inputs_processed['input_values'] is (1, 16000)
# Method 2: Passing processed inputs to the model
with torch.no_grad():
outputs_model = model(inputs_processed['input_values'])
features = outputs_model.last_hidden_state
# The shape of features is (1, 49, 768)

Based on the above data, answer the given subquestions.

  1. A

    To convert the raw audio waveform into a sequence of contextualized hidden states.

  2. B

    To normalize the raw audio waveform and prepare it in the correct tensor format for the model.

  3. C

    To downsample the audio from its native sampling rate to 16000 Hz.

  4. D

    To tokenize the audio into a sequence of discrete units, similar to a text tokenizer.

Show answer

Correct answer

  • B

    To normalize the raw audio waveform and prepare it in the correct tensor format for the model.

Question 8

+5 marksNumerical answer

Consider the following code snippet that processes a raw audio sample first with a Wav2Vec2Processor and then with a Wav2Vec2Model.

python
from transformers import Wav2Vec2Processor, Wav2Vec2Model
import torch
processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-base-960h")
model = Wav2Vec2Model.from_pretrained("facebook/wav2vec2-base-960h")
# A 1-second audio sample at 16kHz
sample_audio = torch.randn(1, 16000)
# Method 1: Processing the audio
inputs_processed = processor(sample_audio, sampling_rate=16000, return_tensors="pt")
# The shape of inputs_processed['input_values'] is (1, 16000)
# Method 2: Passing processed inputs to the model
with torch.no_grad():
outputs_model = model(inputs_processed['input_values'])
features = outputs_model.last_hidden_state
# The shape of features is (1, 49, 768)

Based on the above data, answer the given subquestions.

The model's output features has a sequence length of 49, while the input audio had a length of 16000 samples. Based on these values, what is the approximate downsampling factor applied by the Wav2Vec2Model's feature encoder (the CNN part)? Provide the answer rounded to the nearest integer.

Show answer

Correct answer: 327

Question 9

+5 marksOne or more correct options

Consider the following code snippet that processes a raw audio sample first with a Wav2Vec2Processor and then with a Wav2Vec2Model.

python
from transformers import Wav2Vec2Processor, Wav2Vec2Model
import torch
processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-base-960h")
model = Wav2Vec2Model.from_pretrained("facebook/wav2vec2-base-960h")
# A 1-second audio sample at 16kHz
sample_audio = torch.randn(1, 16000)
# Method 1: Processing the audio
inputs_processed = processor(sample_audio, sampling_rate=16000, return_tensors="pt")
# The shape of inputs_processed['input_values'] is (1, 16000)
# Method 2: Passing processed inputs to the model
with torch.no_grad():
outputs_model = model(inputs_processed['input_values'])
features = outputs_model.last_hidden_state
# The shape of features is (1, 49, 768)

Based on the above data, answer the given subquestions.

Select all that apply.

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

Correct answers

  • A
  • C
  • D

Question 10

+5 marksOne correct option

You are fine-tuning a Wav2Vec2ForCTC model for an ASR task using the Hugging Face Trainer. The following TrainingArguments are used:

python
from transformers import TrainingArguments
training_args = TrainingArguments(
output_dir="AsrTaskModel",
group_by_length=True,
per_device_train_batch_size=8,
evaluation_strategy="steps",
num_train_epochs=7,
fp16=True,
save_steps=1000,
eval_steps=500,
learning_rate=1e-4,
warmup_steps=1000,
save_total_limit=2,
load_best_model_at_end=True,
)

Based on the above data, answer the given subquestions.

  1. A

    To sort the entire dataset by audio duration before training begins.

  2. B

    To ensure each batch contains audios of exactly the same length, eliminating the need for padding.

  3. C

    To create batches with samples of similar input length, which minimizes the amount of padding required and improves training efficiency.

  4. D

    To group samples by the length of their text transcription rather than their audio length.

Show answer

Correct answer

  • C

    To create batches with samples of similar input length, which minimizes the amount of padding required and improves training efficiency.

Question 11

+5 marksOne or more correct options

You are fine-tuning a Wav2Vec2ForCTC model for an ASR task using the Hugging Face Trainer. The following TrainingArguments are used:

python
from transformers import TrainingArguments
training_args = TrainingArguments(
output_dir="AsrTaskModel",
group_by_length=True,
per_device_train_batch_size=8,
evaluation_strategy="steps",
num_train_epochs=7,
fp16=True,
save_steps=1000,
eval_steps=500,
learning_rate=1e-4,
warmup_steps=1000,
save_total_limit=2,
load_best_model_at_end=True,
)

Based on the above data, answer the given subquestions.

Select all that apply.

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

Correct answers

  • A
  • B
  • C
  • E