MCPcopy Create free account
hub / github.com/Physical-Intelligence/openpi / test_normalize_update

Function test_normalize_update

src/openpi/shared/normalize_test.py:6–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6def test_normalize_update():
7 arr = np.arange(12).reshape(4, 3) # 4 vectors of length 3
8
9 stats = normalize.RunningStats()
10 for i in range(len(arr)):
11 stats.update(arr[i : i + 1]) # Update with one vector at a time
12 results = stats.get_statistics()
13
14 assert np.allclose(results.mean, np.mean(arr, axis=0))
15 assert np.allclose(results.std, np.std(arr, axis=0))
16
17
18def test_serialize_deserialize():

Callers

nothing calls this directly

Calls 2

updateMethod · 0.95
get_statisticsMethod · 0.95

Tested by

no test coverage detected