uiz Space

January 2025 term · Deep Learning Practice · BSDA5013

Deep Learning Practice Quiz 2: 16 March 2025 (January 2025 term)

The IIT Madras BS Deep Learning Practice (Deep Learning Practice) Quiz 2 paper sat on 16 Mar 2025, in the January 2025 term: 19 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
19
Marks
50
Duration
120 min
MCQ
9
MSQ
8
Numerical
2

Updated

Official paper: IIT M DEGREE AN EXAM QDB2 16 Mar 2025 · No negative marking.

Question 1

+3 marksOne correct option

Consider the following code using Wav2Vec2Processor to process an audio sample:

python
import torch
from transformers import Wav2Vec2Processor
processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-base-960h")
sample_audio = {"array": torch.randn(12000), "sampling_rate": 16000}
inputs = processor(sample_audio["array"], sampling_rate=16000, return_tensors="pt", padding=True)
print(inputs["input_values"].shape)

What will the printed shape be?

  1. A

    (1, 16000)

  2. B

    (1, X), where X depends on the model

  3. C

    (1, 12000)

  4. D

    Error: Wav2Vec2Processor does not support PyTorch tensors

Show answer

Correct answer

  • C

    (1, 12000)

Question 2

+3 marksOne correct option

Consider the following code snippet:

python
from transformers import Wav2Vec2Processor
processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-large-960h")
input_values = processor("audio.wav", return_tensors="pt", sampling_rate=16000).input_values

What is the primary mistake in this code?

  1. A

    return_tensors="pt" should be return_tensors="np".

  2. B

    input_values should be extracted using .input_values[0] to match expected dimensions.

  3. C

    The sampling_rate argument should be passed during from_pretrained(), not while calling processor().

  4. D

    processor cannot process raw audio file paths, only arrays of audio samples.

Show answer

Correct answer

  • D

    processor cannot process raw audio file paths, only arrays of audio samples.

Question 3

+3 marksOne correct option

You have a model that predicts transcriptions for audio clips. You calculate Word Error Rate (WER) using the jiwer package as follows:

python
from jiwer import wer
ground_truth = ["hello world", "this is a test"]
predictions = ["hello word", "this test"]
error = wer(ground_truth, predictions)
print(f"WER: {error:.2f}")

What will be the output of this code?

  1. A

    WER: 0.25

  2. B

    WER: 0.50

  3. C

    WER: 0.33

  4. D

    WER: 0.67

Show answer

Correct answer

  • B

    WER: 0.50

Question 4

+2 marksOne correct option

What type of language modeling objective does the Whisper model use during training?

  1. A

    Causal Language Modeling (CLM)

  2. B

    Sequence-to-Sequence Learning (S2S)

  3. C

    Masked Language Modeling (MLM)

  4. D

    Self-Supervised Contrastive Learning

Show answer

Correct answer

  • B

    Sequence-to-Sequence Learning (S2S)

Question 5

+2 marksOne correct option

Why is Wav2Vec2CTCTokenizer used instead of directly using Wav2Vec2Processor for tokenization?

  1. A

    Wav2Vec2CTCTokenizer provides more flexibility for tokenization strategies.

  2. B

    Wav2Vec2CTCTokenizer is optimized for Transformer models.

  3. C

    Wav2Vec2Processor only works with speech data, not text labels.

  4. D

    Both are equivalent and interchangeable.

Show answer

Correct answer

  • C

    Wav2Vec2Processor only works with speech data, not text labels.

Question 6

+2 marksOne correct option
  1. A

    Probability distributions over all possible phonemes.

  2. B

    Probability distributions over all tokens in the vocabulary.

  3. C

    Raw unnormalized scores for each phoneme.

  4. D

    Raw unnormalized scores for each token in the vocabulary.

Show answer

Correct answer

  • D

    Raw unnormalized scores for each token in the vocabulary.

Question 7

+2 marksOne correct option

Which of the following correctly describes the end-to-end ASR workflow when training a Wav2Vec2 model?

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

Correct answer

  • C

Question 8

+3 marksOne or more correct options

Which of the following statements are True?

Select all that apply.

  1. A

    The Wav2Vec2Model takes a raw audio waveform and converts it into input_values (which are normalized and padded).

  2. B

    The Wav2Vec2Processor takes a raw audio waveform and converts it into input_values (which are normalized and padded).

  3. C

    Both Wav2Vec2Model and Wav2Vec2Processor involve deep neural networks in their architectures.

  4. D

    Like BERT, Wav2Vec2 applies masked learning to the audio representations.

  5. E

    Wav2Vec2 processes audio in a left-to-right manner like GPT (which uses CLM).

Show answer

Correct answers

  • B

    The Wav2Vec2Processor takes a raw audio waveform and converts it into input_values (which are normalized and padded).

  • D

    Like BERT, Wav2Vec2 applies masked learning to the audio representations.

Question 9

+3 marksOne or more correct options

You transcribed an audio recording using Whisper and applied speaker diarization. However, you notice that the transcribed text is accurate, but the speaker labels frequently change mid- sentence, even when the same person is speaking.
Which of the following are definite causes of this issue?

Select all that apply.

  1. A

    The speaker segments are too short, causing the clustering model to misclassify speakers.

  2. B

    Whisper does not support speaker diarization, so the labels are randomly assigned.

  3. C

    The timestamps from Whisper do not align with the diarization output, leading to incorrect speaker switching.

  4. D

    The transcription model has misrecognized words, which affects speaker identification.

Show answer

Correct answers

  • A

    The speaker segments are too short, causing the clustering model to misclassify speakers.

  • C

    The timestamps from Whisper do not align with the diarization output, leading to incorrect speaker switching.

Question 10

+3 marksOne or more correct options

Consider the following Whisper transcription function:

python
from faster_whisper import WhisperModel
model = WhisperModel("large-v2")
def transcribe_audio(audio_file):
segments, info = model.transcribe(audio_file, beam_size=3)
return [segment.text for segment in segments]

Which of the following statements are correct about this code?

Select all that apply.

  1. A

    It loads a large pre-trained Whisper model for transcription.

  2. B

    It splits the audio into segments and returns the transcribed text.

  3. C

    It performs speaker diarization in addition to transcription.

  4. D

    The beam_size=3 ensures that the output will always be 100% accurate.

Show answer

Correct answers

  • A

    It loads a large pre-trained Whisper model for transcription.

  • B

    It splits the audio into segments and returns the transcribed text.

Question 11

+3 marksOne or more correct options

A speaker diarization pipeline typically consists of multiple components.
Which of the following components are essential in a speaker diarization system?

Select all that apply.

  1. A

    Voice Activity Detection (VAD) to remove non-speech segments.

  2. B

    Speaker Embedding Extraction (e.g., ECAPA-TDNN, x-vectors) to represent speaker characteristics.

  3. C

    Speech-to-Text Transcription to convert spoken words into text.

  4. D

    Clustering (e.g., Agglomerative Clustering, K-Means) to group similar speaker embeddings.

  5. E

    Automatic Language Identification (ALI) to detect the spoken language.

Show answer

Correct answers

  • A

    Voice Activity Detection (VAD) to remove non-speech segments.

  • B

    Speaker Embedding Extraction (e.g., ECAPA-TDNN, x-vectors) to represent speaker characteristics.

  • D

    Clustering (e.g., Agglomerative Clustering, K-Means) to group similar speaker embeddings.

Question 12

+3 marksOne or more correct options

Select all that apply.

  1. A

    It requires both text and speaker embeddings as inputs.

  2. B

    The decoder input is compressed by a factor of 2 during training.

  3. C

    It transcribes speech into text like Whisper.

  4. D

    It can only generate speech in English.

Show answer

Correct answers

  • A

    It requires both text and speaker embeddings as inputs.

  • B

    The decoder input is compressed by a factor of 2 during training.

Question 13

+3 marksNumerical answer

The following code snippet uses librosa to process an audio file:

python
import librosa
audio_file = "audio.wav"
audio_data, sample_rate = librosa.load(audio_file, sr=16000)

If audio_data.shape outputs (320000,), how long (in seconds) is the audio file?

Show answer

Correct answer: 20

Question 14

+2 marksNumerical answer

Below is a snippet for loading a SpeechBrain speaker verification model:

python
from speechbrain.pretrained import SpeakerRecognition
verification_model = SpeakerRecognition.from_hparams(
source="speechbrain/spkrec-xvect-voxceleb",
savedir="tmp/spkrec-xvect")

The speaker verification model uses x-vector embeddings of size 512. If an audio dataset has 100 speakers, calculate the total embedding parameters stored in the model.

Show answer

Correct answer: 51200

Question 15

+3 marksOne correct option

Consider the following 1D Convolutional Neural Network code:

python
import torch
import torch.nn as nn
conv = nn.Conv1d(in_channels=64, out_channels=128, kernel_size=5, stride=1, padding=2)
maxpool = nn.MaxPool1d(kernel_size=2, stride=2)
x = torch.randn(1, 64, 100) # (batch_size, channels, sequence_length)
conv_out = conv(x)
pool_out = maxpool(conv_out)
print(conv_out.shape)
print(pool_out.shape)

Based on the above data, answer the given subquestions.

What will be the printed shape of conv_out and pool_out?

  1. A

    conv_out: (1, 128, 100), pool_out: (1, 128, 100)

  2. B

    conv_out: (1, 128, 96), pool_out: (1, 128, 48)

  3. C

    conv_out: (1, 128, 100), pool_out: (1, 128, 50)

  4. D

    conv_out: (1, 128, 102), pool_out: (1, 128, 51)

Show answer

Correct answer

  • C

    conv_out: (1, 128, 100), pool_out: (1, 128, 50)

Question 16

+4 marksOne or more correct options

Consider the following 1D Convolutional Neural Network code:

python
import torch
import torch.nn as nn
conv = nn.Conv1d(in_channels=64, out_channels=128, kernel_size=5, stride=1, padding=2)
maxpool = nn.MaxPool1d(kernel_size=2, stride=2)
x = torch.randn(1, 64, 100) # (batch_size, channels, sequence_length)
conv_out = conv(x)
pool_out = maxpool(conv_out)
print(conv_out.shape)
print(pool_out.shape)

Based on the above data, answer the given subquestions.

Which of the following changes will reduce the output sequence length?

Select all that apply.

  1. A

    Increasing padding

  2. B

    Increasing kernel size

  3. C

    Increasing stride

  4. D

    Increasing maxpool size

Show answer

Correct answers

  • B

    Increasing kernel size

  • C

    Increasing stride

  • D

    Increasing maxpool size

Question 17

+2 marksOne correct option

Below is a snippet for fine-tuning SpeechT5 for Text-to-Speech (TTS):

python
from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, Trainer, TrainingArguments
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts")
training_args = TrainingArguments(
output_dir="./speechT5-finetuned",
per_device_train_batch_size=8,
gradient_accumulation_steps=2,
learning_rate=3e-5,
num_train_epochs=3,
save_strategy="epoch"
)

Based on the above data, answer the given subquestions.

What is the primary input format required for fine-tuning SpeechT5?

  1. A

    Raw speech waveforms only.

  2. B

    Speaker embeddings only.

  3. C

    A combination of text and speaker embeddings.

  4. D

    MFCC features extracted from audio.

Show answer

Correct answer

  • C

    A combination of text and speaker embeddings.

Question 18

+2 marksOne or more correct options

Below is a snippet for fine-tuning SpeechT5 for Text-to-Speech (TTS):

python
from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, Trainer, TrainingArguments
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts")
training_args = TrainingArguments(
output_dir="./speechT5-finetuned",
per_device_train_batch_size=8,
gradient_accumulation_steps=2,
learning_rate=3e-5,
num_train_epochs=3,
save_strategy="epoch"
)

Based on the above data, answer the given subquestions.

What additional preprocessing is required when fine-tuning SpeechT5 on low-resource languages?

Select all that apply.

  1. A

    Use phoneme-based tokenization instead of direct text tokenization.

  2. B

    Train on speaker embeddings that include multiple dialects.

  3. C

    Convert all text to uppercase for better model accuracy.

  4. D

    Increase the hidden size of the transformer layers to accommodate new languages.

Show answer

Correct answers

  • A

    Use phoneme-based tokenization instead of direct text tokenization.

  • B

    Train on speaker embeddings that include multiple dialects.

Question 19

+2 marksOne or more correct options

Below is a snippet for fine-tuning SpeechT5 for Text-to-Speech (TTS):

python
from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, Trainer, TrainingArguments
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts")
training_args = TrainingArguments(
output_dir="./speechT5-finetuned",
per_device_train_batch_size=8,
gradient_accumulation_steps=2,
learning_rate=3e-5,
num_train_epochs=3,
save_strategy="epoch"
)

Based on the above data, answer the given subquestions.

Which of the following statements are true about the fine-tuning process?

Select all that apply.

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

Correct answers

  • A
  • D