July 2019
Intermediate to advanced
512 pages
19h 39m
English
As we learned, the generator performs the transpose convolutional operation. The generator is composed of convolutional transpose and batch norm layers with ReLU activations. We apply batch normalization to every layer except for the last layer. Also, we apply ReLU activations to every layer, but for the last layer, we apply the tanh activation function to scale the generated image between -1 and +1:
def generator(z, z_dim, batch_size, is_training=False, reuse=False): with tf.variable_scope('generator', reuse=reuse):
First fully connected layer:
input_to_conv = tf.layers.dense(z, 8*8*128)
Convert the shape of the input and apply batch normalization followed by ReLU activations:
layer1 = tf.reshape(input_to_conv, ...
Read now
Unlock full access