gan.py 文件源码

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

项目:Machine-Learning 作者: hadikazemi 项目源码 文件源码
def generator(inputs, reuse=False):
    with tf.variable_scope('generator'):
        if reuse:
            tf.get_variable_scope().reuse_variables()
        net = lays.fully_connected(inputs, 4*4*256, scope='fc1')
        net = tf.reshape(net, (batch_size, 4, 4, 256))
        net = lays.conv2d_transpose(net, 128, 3, stride=2, scope='conv1', padding='SAME', activation_fn=leaky_relu)
        net = lays.conv2d_transpose(net, 64, 3, stride=2, scope='conv2', padding='SAME', activation_fn=leaky_relu)
        net = lays.conv2d_transpose(net, 64, 3, stride=2, scope='conv3', padding='SAME', activation_fn=leaky_relu)
        net = lays.conv2d(net, 3, 3, scope='conv4', padding='SAME', activation_fn=tf.nn.tanh)
        return net


# Define the Discriminator, a simple CNN with 3 convolution and 2 fully connected layers
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号