(self, x, eps=0.00001)
| 283 | # normalization, pointwise gaussian |
| 284 | class UnitGaussianNormalizer(object): |
| 285 | def __init__(self, x, eps=0.00001): |
| 286 | super(UnitGaussianNormalizer, self).__init__() |
| 287 | |
| 288 | # x could be in shape of ntrain*n or ntrain*T*n or ntrain*n*T |
| 289 | self.mean = torch.mean(x, 0) |
| 290 | self.std = torch.std(x, 0) |
| 291 | self.eps = eps |
| 292 | |
| 293 | def encode(self, x): |
| 294 | x = (x - self.mean) / (self.std + self.eps) |