ops.py 文件源码

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

项目:tf-sr-zoo 作者: MLJejuCamp2017 项目源码 文件源码
def upsample_layer(x, scope = None, scale = 2,  mode = 'bilinear'):
    if mode == 'deconv':
        conv = slim.conv2d_transpose(x, 64, [4,4], stride = scale, activation_fn = lrelu, scope = scope)
        conv = slim.conv2d(conv, 3,[3,3], activation_fn = None)
        return conv
    if mode == 'bilinear':
        shape = x.get_shape().as_list()
        h = shape[1]
        w = shape[2]
        conv = tf.image.resize_images(x, (scale*h, scale*w))
        conv = slim.conv2d(conv, 3, [1,1], activation_fn = None)
        return conv
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号