MCPcopy Create free account
hub / github.com/BorealisAI/scaleformer / __init__

Method __init__

layers/utils.py:285–291  ·  view source on GitHub ↗
(self, x, eps=0.00001)

Source from the content-addressed store, hash-verified

283# normalization, pointwise gaussian
284class 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)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected