convolution_2d.py 文件源码

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

项目:chainer-speech-recognition 作者: musyoku 项目源码 文件源码
def __call__(self, x):
        if self.g.data is None:
            if self.V.data is None:
                kh, kw = _pair(self.ksize)
                V_shape = (self.out_channels, x.shape[1], kh, kw)
                self.V.initialize(V_shape)
            xp = cuda.get_array_module(x)
            with chainer.no_backprop_mode():
                t = convolution_2d(x, self.V, Variable(xp.full((self.out_channels, 1, 1, 1), 1.0).astype(x.dtype)), None, self.stride, self.pad)    # compute output with g = 1 and without bias
            mean_t, std_t = self._initialize_params(t.data)
            return (t - mean_t) / std_t

        return convolution_2d(x, self.V, self.g, self.b, self.stride, self.pad)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号