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)
convolution_2d.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录