MCPcopy
hub / github.com/PaddlePaddle/PARL / push

Method push

examples/ES/obs_filter.py:50–64  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

48 return other
49
50 def push(self, x):
51 x = np.asarray(x)
52 # Unvectorized update of the running statistics.
53 if x.shape != self._M.shape:
54 raise ValueError(
55 "Unexpected input shape {}, expected {}, value = {}".format(
56 x.shape, self._M.shape, x))
57 n1 = self._n
58 self._n += 1
59 if self._n == 1:
60 self._M[...] = x
61 else:
62 delta = x - self._M
63 self._M[...] += delta / self._n
64 self._S[...] += delta * delta * n1 / self._n
65
66 def update(self, other):
67 n1 = self._n

Callers 15

ansi_up.jsFile · 0.45
uFunction · 0.45
_eFunction · 0.45
noFunction · 0.45
ioFunction · 0.45
zaFunction · 0.45
fFunction · 0.45
gFunction · 0.45
atFunction · 0.45
WtFunction · 0.45
eeFunction · 0.45

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected