policy.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:photo-editing-tensorflow 作者: JamesChuanggg 项目源码 文件源码
def discriminator(self, image, reuse=False):

        with tf.variable_scope("discriminator") as scope:
            if reuse:
                scope.reuse_variables()

            image_norm = tf.div(image, 255.)
            h0 = lrelu(conv2d(image_norm, self.df_dim, name='d_h0_conv'))
            h1 = lrelu(self.d_bn1(conv2d(h0, self.df_dim*2, name='d_h1_conv')))
            h2 = lrelu(self.d_bn2(conv2d(h1, self.df_dim*4, name='d_h2_conv')))
            h3 = lrelu(self.d_bn3(conv2d(h2, self.df_dim*8, name='d_h3_conv')))
            h4 = linear(tf.reshape(h3, [self.batch_size, -1]), 1, 'd_h3_lin')
            # Prevent NAN
            h4 += 1e-5
            h4_ = tf.nn.sigmoid(h4) + 1e-5

            return h4_, h4
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号