def discriminate(self, x_var, y, weights, biases, reuse=False):
y1 = tf.reshape(y, shape=[self.batch_size, 1, 1, self.y_dim])
x_var = conv_cond_concat(x_var, y1)
conv1= lrelu(conv2d(x_var, weights['wc1'], biases['bc1']))
conv1 = conv_cond_concat(conv1, y1)
conv2= lrelu(batch_normal(conv2d(conv1, weights['wc2'], biases['bc2']), scope='dis_bn1', reuse=reuse))
conv2 = tf.reshape(conv2, [self.batch_size, -1])
conv2 = tf.concat([conv2, y], 1)
fc1 = lrelu(batch_normal(fully_connect(conv2, weights['wc3'], biases['bc3']), scope='dis_bn2', reuse=reuse))
fc1 = tf.concat([fc1, y], 1)
#for D
output= fully_connect(fc1, weights['wd'], biases['bd'])
return tf.nn.sigmoid(output)
评论列表
文章目录