0
0
PyTorchml~5 mins

Generator and discriminator in PyTorch - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the role of the generator in a GAN?
The generator creates fake data that looks like real data to fool the discriminator.
Click to reveal answer
beginner
What does the discriminator do in a GAN?
The discriminator tries to tell apart real data from fake data produced by the generator.
Click to reveal answer
intermediate
Why do the generator and discriminator compete in GAN training?
They compete so the generator improves at making realistic data, and the discriminator improves at spotting fakes.
Click to reveal answer
intermediate
In PyTorch, what is a simple way to define a generator model?
Use torch.nn.Module to build layers that take random noise as input and output fake data.
Click to reveal answer
intermediate
What loss function is commonly used for the discriminator in GANs?
Binary cross-entropy loss is used to measure how well the discriminator classifies real vs fake data.
Click to reveal answer
What input does the generator in a GAN usually take?
AReal images
BDiscriminator output
CLabels
DRandom noise vector
What is the main goal of the discriminator?
AOptimize generator weights
BGenerate fake data
CClassify data as real or fake
DCreate noise vectors
Which loss function is typically used to train the discriminator?
ABinary cross-entropy
BCategorical cross-entropy
CMean squared error
DHinge loss
During GAN training, what happens when the discriminator gets better?
AGenerator stops learning
BGenerator performance improves
CTraining ends
DDiscriminator generates data
Which PyTorch class is used to create generator and discriminator models?
Atorch.nn.Module
Btorch.utils.data.Dataset
Ctorch.optim.Optimizer
Dtorch.Tensor
Explain how the generator and discriminator work together in a GAN.
Think of a game where one tries to fool and the other tries to detect.
You got /4 concepts.
    Describe how you would implement a simple generator model in PyTorch.
    Start from random noise and build a small neural network.
    You got /4 concepts.