MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / smooth

Function smooth

rl3/plot_es_mujoco_results.py:5–12  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

3import numpy as np
4
5def smooth(x):
6 # last 100
7 n = len(x)
8 y = np.zeros(n)
9 for i in range(n):
10 start = max(0, i - 99)
11 y[i] = float(x[start:(i+1)].sum()) / (i - start + 1)
12 return y
13
14j = np.load('es_mujoco_results.npz')
15

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected