July 2019
Intermediate to advanced
512 pages
19h 39m
English
We define a discriminator as a convolutional network with three convolutional layers followed by a fully connected layer. It is composed of a series of convolutional and batch norm layers with leaky ReLU activations. We apply batch normalization at all layers except at the input layer:
def discriminator(input_images, reuse=False, is_training=False, alpha=0.1): with tf.variable_scope('discriminator', reuse= reuse):
First convolutional layer with leaky ReLU activation:
layer1 = tf.layers.conv2d(input_images, filters=64, kernel_size=5, strides=2, padding='same', kernel_initializer=kernel_init, name='conv1') layer1 = tf.nn.leaky_relu(layer1, alpha=0.2, name='leaky_relu1')
Second convolutional layer with batch ...
Read now
Unlock full access