Complete the code to define the input layer for conditional data in a TensorFlow model.
condition_input = tf.keras.Input(shape=([1],), name='condition_input')
The condition input shape is usually a vector of size 1 for simple conditional generation tasks.
Complete the code to concatenate noise and condition inputs for conditional generation.
combined_input = tf.keras.layers.Concatenate()([noise_input, [1]])We concatenate the noise vector with the condition input to feed both into the generator.
Fix the error in the model compilation by completing the loss function argument.
model.compile(optimizer='adam', loss=[1])
For conditional generation tasks, especially GANs, binary_crossentropy is commonly used as the loss function.
Fill both blanks to create a conditional generator model that takes noise and condition inputs.
noise_input = tf.keras.Input(shape=([1],)) condition_input = tf.keras.Input(shape=([2],))
The noise vector is usually 100-dimensional, and the condition vector is 1-dimensional for simple conditions.
Fill all three blanks to build a conditional generator model combining noise and condition inputs.
noise_input = tf.keras.Input(shape=([1],)) condition_input = tf.keras.Input(shape=([2],)) combined = tf.keras.layers.Concatenate()([noise_input, [3]])
The noise input is 100-dimensional, the condition input is 1-dimensional, and we concatenate noise with the condition input.
