Complete the code to import the library used for creating generative models.
import [1]
TensorFlow is a popular library used to build generative models for visual content.
Complete the code to define the input shape for a generative model that creates 28x28 grayscale images.
input_shape = ([1], [2], 1)
The input shape for 28x28 grayscale images is (28, 28, 1).
Fix the error in the code to generate random noise input for the generator.
noise = tf.random.normal(shape=([1], 100))
The batch size for noise input is often 64 for training generative models.
Fill both blanks to complete the generator model's output layer for 28x28 grayscale images.
model.add(tf.keras.layers.Dense(28 * 28 * [1], activation='[2]'))
The output layer should produce 28*28*1 values for grayscale images with sigmoid activation to get pixel values between 0 and 1.
Fill all three blanks to complete the training step that compiles the generative model with optimizer and loss.
model.compile(optimizer='[1]', loss='[2]', metrics=['[3]'])
Adam optimizer is commonly used for generative models, mean squared error (mse) is a typical loss for image generation, and accuracy can be used as a metric.