0
0
PyTorchml~20 mins

Why generative models create data in PyTorch - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Generative Model Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Purpose of Generative Models
Why do generative models create new data samples?
ATo learn the underlying data distribution and generate similar new examples
BTo reduce the size of the dataset by compressing data
CTo classify data into predefined categories
DTo remove noise from existing data samples
Attempts:
2 left
💡 Hint
Think about what it means to 'generate' data in machine learning.
Model Choice
intermediate
1:30remaining
Choosing a Generative Model for Image Creation
Which model is best suited to generate new images similar to a training set?
AConvolutional Neural Network (CNN) for classification
BGenerative Adversarial Network (GAN)
CRecurrent Neural Network (RNN) for sequence prediction
DSupport Vector Machine (SVM)
Attempts:
2 left
💡 Hint
Look for a model designed to create new data, not just analyze or classify.
Predict Output
advanced
2:00remaining
Output Shape of Generated Data
What is the shape of the output tensor from the generator in this PyTorch GAN code snippet?
PyTorch
import torch
import torch.nn as nn

class Generator(nn.Module):
    def __init__(self):
        super().__init__()
        self.net = nn.Sequential(
            nn.Linear(100, 256),
            nn.ReLU(),
            nn.Linear(256, 784),
            nn.Tanh()
        )
    def forward(self, x):
        return self.net(x)

g = Generator()
noise = torch.randn(16, 100)
output = g(noise)
output_shape = output.shape
Atorch.Size([16, 784])
Btorch.Size([100, 16])
Ctorch.Size([16, 256])
Dtorch.Size([784, 16])
Attempts:
2 left
💡 Hint
Check the input batch size and the final layer output size.
Metrics
advanced
1:30remaining
Evaluating Generative Model Quality
Which metric is commonly used to evaluate the quality of images generated by a GAN?
AAccuracy
BMean Squared Error (MSE)
CInception Score (IS)
DCross-Entropy Loss
Attempts:
2 left
💡 Hint
This metric measures how realistic and diverse generated images are.
🔧 Debug
expert
2:00remaining
Identifying the Cause of Mode Collapse in GAN Training
During GAN training, the generator produces very similar images repeatedly, showing mode collapse. What is the most likely cause?
AThe discriminator is too weak and cannot distinguish real from fake images
BThe generator's learning rate is too low, causing slow updates
CThe generator is overfitting the training data
DThe discriminator is too strong, overpowering the generator
Attempts:
2 left
💡 Hint
Mode collapse often happens when one part of the GAN dominates the other.