(self, x, low=0.0, high=1.0)
| 322 | # normalization, scaling by range |
| 323 | class RangeNormalizer(object): |
| 324 | def __init__(self, x, low=0.0, high=1.0): |
| 325 | super(RangeNormalizer, self).__init__() |
| 326 | mymin = torch.min(x, 0)[0].view(-1) |
| 327 | mymax = torch.max(x, 0)[0].view(-1) |
| 328 | |
| 329 | self.a = (high - low)/(mymax - mymin) |
| 330 | self.b = -self.a*mymax + high |
| 331 | |
| 332 | def encode(self, x): |
| 333 | s = x.size() |