e2e_model.py 文件源码

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

项目:dwt 作者: min2209 项目源码 文件源码
def _upscore_layer(self, bottom, shape, params):
        strides = [1, params["stride"], params["stride"], 1]
        with tf.variable_scope(params["name"]):
            in_features = bottom.get_shape()[3].value

            if shape is None:
                in_shape = tf.shape(bottom)

                h = ((in_shape[1] - 1) * params["stride"]) + 1
                w = ((in_shape[2] - 1) * params["stride"]) + 1
                new_shape = [in_shape[0], h, w, params["outputChannels"]]
            else:
                new_shape = [shape[0], shape[1], shape[2], params["outputChannels"]]
                output_shape = tf.pack(new_shape)

                f_shape = [params["ksize"], params["ksize"], params["outputChannels"], in_features]

                weights = self.get_deconv_filter(f_shape, params)
                deconv = tf.nn.conv2d_transpose(bottom, weights, output_shape,
                                                strides=strides, padding='SAME')
        return deconv
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号