()
| 4 | |
| 5 | |
| 6 | def 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 | |
| 18 | def test_serialize_deserialize(): |
nothing calls this directly
no test coverage detected