convolution_2d.py 文件源码

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

项目:chainer-speech-recognition 作者: musyoku 项目源码 文件源码
def _initialize_params(self, t):
        xp = cuda.get_array_module(t)
        # ???????????????????
        mean_t = xp.mean(t, axis=(0, 2, 3)).reshape(1, -1, 1, 1)
        std_t = xp.sqrt(xp.var(t, axis=(0, 2, 3))).reshape(1, -1, 1, 1)
        g = 1 / std_t
        b = -mean_t / std_t

        # print "g <- {}, b <- {}".format(g.reshape((-1,)), b.reshape((-1,)))

        with self.init_scope():
            if self.nobias == False:
                self.b = variable.Parameter(b.reshape((-1,)))
            self.g = variable.Parameter(g.reshape((self.out_channels, 1, 1, 1)))

        return mean_t, std_t
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号