diff options
| author | zhang <zch921005@126.com> | 2022-03-25 00:11:34 +0800 |
|---|---|---|
| committer | zhang <zch921005@126.com> | 2022-03-25 00:11:34 +0800 |
| commit | 3ed1c5d0e4018fc70012a6209a859a059f7127b5 (patch) | |
| tree | 2ca318fb2e23daf2964189a751fb61b20aa7515a /dl/bn/np_demo.py | |
| parent | 6f68e1818229e0d2dad760062e6b5bb137b88f5b (diff) | |
更新脚本
Diffstat (limited to 'dl/bn/np_demo.py')
| -rw-r--r-- | dl/bn/np_demo.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/dl/bn/np_demo.py b/dl/bn/np_demo.py new file mode 100644 index 0000000..9cd6296 --- /dev/null +++ b/dl/bn/np_demo.py @@ -0,0 +1,28 @@ + +import numpy as np +import matplotlib.pyplot as plt + + +batch = np.zeros([2, 3, 3, 3]) +batch[0, :, :, 0] = np.asarray([[2.4, 0.3, 5.6], + [7.2, 0.0, 2.1], + [1.9, 7.4, 4.1]]) +batch[0, :, :, 1] = np.asarray([[1.0, 2.1, 3.8], + [9.6, 2.0, 4.4], + [9.3, 3.9, 1.4]]) +batch[0, :, :, 2] = np.asarray([[2.6, 8.1, 9.0], + [2.2, 6.6, 0.2], + [6.3, 6.0, 0.1]]) + +batch[1, :, :, 0] = np.asarray([[5.1, 9.0, 6.9], + [9.7, 2.9, 2.4], + [6.2, 0.7, 4.3]]) +batch[1, :, :, 1] = np.asarray([[3.3, 7.9, 4.8], + [3.7, 2.0, 9.4], + [4.9, 2.1, 7.8]]) + +batch[1, :, :, 2] = np.asarray([[2.8, 5.4, 0.0], + [6.4, 1.8, 6.8], + [3.7, 5.6, 5.6]]) +print(batch[:, :, :, 0].mean()) +print(batch[:, :, :, 0].var())
\ No newline at end of file |
