Recall & Review
beginner
What is the purpose of
torchvision.datasets in data loading?It provides ready-to-use datasets for computer vision tasks, making it easy to download, load, and preprocess common image datasets.
Click to reveal answer
beginner
Explain the role of
torch.utils.data.DataLoader.It wraps a dataset and provides an iterable over the data with support for batching, shuffling, and parallel loading using multiple workers.
Click to reveal answer
beginner
How do
transforms help in data loading with torchvision?Transforms apply preprocessing steps like resizing, cropping, normalization, and data augmentation to images before feeding them to the model.
Click to reveal answer
beginner
What does setting
shuffle=True in DataLoader do?It randomizes the order of data samples each epoch to help the model generalize better by preventing learning the order of data.
Click to reveal answer
intermediate
Why use
num_workers in DataLoader?It allows loading data in parallel using multiple subprocesses, speeding up data preparation especially for large datasets.
Click to reveal answer
Which torchvision class is used to load datasets like CIFAR10 or MNIST?
✗ Incorrect
torchvision.datasets provides classes to download and load popular vision datasets.
What does the
batch_size parameter in DataLoader control?✗ Incorrect
batch_size sets how many samples are returned in each batch during iteration.
Which transform would you use to convert images to tensors?
✗ Incorrect
ToTensor converts PIL images or numpy arrays to PyTorch tensors.
Why is shuffling data important during training?
✗ Incorrect
Shuffling helps the model learn general patterns rather than the order of data.
What is the effect of increasing
num_workers in DataLoader?✗ Incorrect
More workers load data in parallel, reducing waiting time for batches.
Describe the steps to load and prepare an image dataset using torchvision.
Think about dataset, transforms, and DataLoader roles.
You got /3 concepts.
Explain why data augmentation is important and how torchvision supports it during data loading.
Consider how transforms help the model see different versions of images.
You got /3 concepts.