def __call__(self, x):
if chainer.config.train == False:
return x
xp = cuda.get_array_module(x.data)
std = math.log(self.std ** 2)
noise = functions.gaussian(chainer.Variable(xp.zeros_like(x.data)), chainer.Variable(xp.full_like(x.data, std)))
return x + noise
# Link
评论列表
文章目录