def __discriminator(self, x, scope, reuse):
with tf.variable_scope(scope, reuse=reuse):
x1 = tf.layers.conv2d(x, 64, 5, strides=2, padding='same')
x1 = LeakyReLU(x1, self.alpha)
# 16x16x64
x2 = tf.layers.conv2d(x1, 128, 5, strides=2, padding='same')
x2 = tf.layers.batch_normalization(x2, training=self.training)
x2 = LeakyReLU(x2, self.alpha)
# 8x8x128
x3 = tf.layers.conv2d(x2, 256, 5, strides=2, padding='same')
x3 = tf.layers.batch_normalization(x3, training=self.training)
x3 = LeakyReLU(x3, self.alpha)
# 4x4x256
# Flatten it
flat = tf.reshape(x3, (-1, 4*4*256))
logits = tf.layers.dense(flat, 1)
out = tf.sigmoid(logits)
return out, logits
#---------------------------------------------------------------------------
评论列表
文章目录