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