In this section, we are going to implement a helper function that we'll define the model input placeholders which will responsible for feeding the data the the computational graph.
The functions should be able to create three main placeholders:
- Actual input images from the dataset which will have the dimensions of (batch size, input image width, input image height, number of channels)
- The latent space Z, which will be used by the generator for generating fake images
- Learning rate placeholder
The helper function will return a tuple of these three input placeholders. So, let's go ahead and define this function:
# defining the model inputs
def inputs(img_width, img_height, img_channels, latent_space_z_dim):
true_inputs = tf.placeholder(tf.float32, (None, img_width, img_height, img_channels),
'true_inputs')
l_space_inputs = tf.placeholder(tf.float32, (None, latent_space_z_dim), 'l_space_inputs')
model_learning_rate = tf.placeholder(tf.float32, name='model_learning_rate')
return true_inputs, l_space_inputs, model_learning_rate