0
0
Computer Visionml~10 mins

Why generative models create visual content in Computer Vision - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the library used for creating generative models.

Computer Vision
import [1]
Drag options to blanks, or click blank then click option'
Atensorflow
Bnumpy
Cpandas
Dmatplotlib
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing numpy which is for numerical operations but not specifically for generative models.
Choosing matplotlib which is for plotting, not model building.
2fill in blank
medium

Complete the code to define the input shape for a generative model that creates 28x28 grayscale images.

Computer Vision
input_shape = ([1], [2], 1)
Drag options to blanks, or click blank then click option'
A28
B3
C64
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 3 channels which is for color images.
Using 64 which is a common size but not for this example.
3fill in blank
hard

Fix the error in the code to generate random noise input for the generator.

Computer Vision
noise = tf.random.normal(shape=([1], 100))
Drag options to blanks, or click blank then click option'
A100
B64
C32
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 which is too small for batch processing.
Using 100 which is the noise vector size, not batch size.
4fill in blank
hard

Fill both blanks to complete the generator model's output layer for 28x28 grayscale images.

Computer Vision
model.add(tf.keras.layers.Dense(28 * 28 * [1], activation='[2]'))
Drag options to blanks, or click blank then click option'
A1
Brelu
Csigmoid
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using 3 channels which is for color images.
Using relu activation which is not suitable for output pixel values.
5fill in blank
hard

Fill all three blanks to complete the training step that compiles the generative model with optimizer and loss.

Computer Vision
model.compile(optimizer='[1]', loss='[2]', metrics=['[3]'])
Drag options to blanks, or click blank then click option'
Aadam
Bmse
Caccuracy
Dsgd
Attempts:
3 left
💡 Hint
Common Mistakes
Using SGD optimizer which is less common for generative models.
Using categorical crossentropy loss which is for classification.