【发布时间】:2021-10-21 19:36:14
【问题描述】:
我正在尝试在 python 中创建和堆叠多个多维数组,但我似乎无法做到这一点。
我有:
y_0 = np.random.uniform(-1.0,1.0, size=(1,1,s_conn.weights.shape[0],1))
y_1 = np.random.uniform(-500.0, 500.0, size=(1,1,s_conn.weights.shape[0],1))
y_2 = np.random.uniform(-50.,50., size=(1,1,s_conn.weights.shape[0],1))
y_3 = np.random.uniform(-6.0, 6.0, size=(1,1,s_conn.weights.shape[0],1))
y_4 = np.random.uniform(-20.0, 20.0, size=(1,1,s_conn.weights.shape[0],1))
y_5 = np.random.uniform(-500.,500., size=(1,1,s_conn.weights.shape[0],1))
其中 s.conn 是 NxN 矩阵。
每个数组都有暗点:(1, 1, 10, 1) 我需要的是一个形状数组:(1, 6, 10, 1)
我如何得到它?我尝试了 np.stack 和手动创建和重塑,但我不断得到奇怪/不正确的结果。
如果能得到一些建议,我将不胜感激。
js
【问题讨论】:
-
与轴 1 连接?