0
0
Computer Visionml~20 mins

GAN for image generation in Computer Vision - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
GAN Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the role of the discriminator in a GAN?

In a Generative Adversarial Network (GAN), what is the main job of the discriminator?

ATo generate new images from random noise
BTo optimize the generator's weights directly
CTo classify images as real or fake
DTo reduce the size of the input images
Attempts:
2 left
💡 Hint

Think about which part of the GAN decides if an image looks real or fake.

Predict Output
intermediate
2:00remaining
Output shape of generated images in a GAN

Given the following generator model snippet, what is the shape of the output images?

Computer Vision
import tensorflow as tf
from tensorflow.keras import layers

def build_generator():
    model = tf.keras.Sequential([
        layers.Dense(7*7*128, use_bias=False, input_shape=(100,)),
        layers.BatchNormalization(),
        layers.LeakyReLU(),
        layers.Reshape((7, 7, 128)),
        layers.Conv2DTranspose(64, (5,5), strides=(2,2), padding='same', use_bias=False),
        layers.BatchNormalization(),
        layers.LeakyReLU(),
        layers.Conv2DTranspose(1, (5,5), strides=(2,2), padding='same', use_bias=False, activation='tanh')
    ])
    return model

gen = build_generator()
output_shape = gen.output_shape
A(None, 28, 28, 1)
B(None, 14, 14, 64)
C(None, 7, 7, 128)
D(None, 32, 32, 3)
Attempts:
2 left
💡 Hint

Check the effect of Conv2DTranspose layers with stride 2 and padding 'same' on spatial dimensions.

Hyperparameter
advanced
1:30remaining
Choosing the learning rate for GAN training

Which learning rate is most appropriate to start training a GAN to avoid unstable training?

A1.0
B0.01
C0.1
D0.0002
Attempts:
2 left
💡 Hint

GANs are sensitive to learning rates; too high causes instability.

Metrics
advanced
1:30remaining
Evaluating GAN image quality with Inception Score

What does a higher Inception Score indicate when evaluating GAN-generated images?

AGenerated images have lower resolution
BGenerated images are more diverse and realistic
CGenerated images are more similar to training images pixel-wise
DGenerated images have more noise
Attempts:
2 left
💡 Hint

Inception Score measures both quality and variety of generated images.

🔧 Debug
expert
2:00remaining
Identifying cause of mode collapse in GAN training

During GAN training, the generator produces very similar images repeatedly, losing diversity. What is the most likely cause?

ADiscriminator is too weak and easily fooled
BGenerator learning rate is too low
CBatch size is too large
DNoise input dimension is too high
Attempts:
2 left
💡 Hint

Mode collapse happens when the generator finds a small set of outputs that fool the discriminator easily.