0
0
PyTorchml~5 mins

Data augmentation with transforms in PyTorch - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is data augmentation in machine learning?
Data augmentation is a technique to increase the diversity of training data by applying random transformations like rotation, flipping, or scaling. This helps models learn better and avoid overfitting.
Click to reveal answer
beginner
Name three common image transformations used in PyTorch for data augmentation.
Common transformations include RandomHorizontalFlip (flips image horizontally), RandomRotation (rotates image by a random angle), and ColorJitter (changes brightness, contrast, saturation).
Click to reveal answer
intermediate
How does RandomHorizontalFlip help improve model performance?
RandomHorizontalFlip flips images horizontally at random during training. This teaches the model to recognize objects regardless of left-right orientation, improving generalization.
Click to reveal answer
intermediate
Explain the role of Compose in PyTorch transforms.
Compose lets you chain multiple transformations together. For example, you can rotate, flip, and normalize images in one step by passing a list of transforms to Compose.
Click to reveal answer
intermediate
What is the difference between transforms applied during training and testing?
During training, random transforms are applied to augment data and improve robustness. During testing, deterministic transforms like resizing and normalization are used to keep evaluation consistent.
Click to reveal answer
Which PyTorch transform randomly flips an image horizontally?
ARandomHorizontalFlip
BRandomRotation
CColorJitter
DNormalize
What does the Compose transform do in PyTorch?
AApplies a single transformation
BChains multiple transformations together
CNormalizes images
DLoads images from disk
Why do we apply data augmentation only during training?
ATo make the model robust by showing varied data
BTo speed up training
CTo increase test accuracy
DTo reduce dataset size
Which transform would you use to randomly change image brightness?
AToTensor
BRandomRotation
CRandomCrop
DColorJitter
What is a common transform applied during both training and testing?
ARandomHorizontalFlip
BRandomRotation
CNormalization
DColorJitter
Describe how you would set up data augmentation for training an image classifier using PyTorch transforms.
Think about the sequence of transformations to increase data variety.
You got /4 concepts.
    Explain why data augmentation helps prevent overfitting in machine learning models.
    Consider how seeing different versions of data affects learning.
    You got /4 concepts.