1
np.dotが不正確なのはなぜですか?(n次元配列)
np.dot2つの'float32'2D配列を取得するとします。 res = np.dot(a, b) # see CASE 1 print(list(res[0])) # list shows more digits [-0.90448684, -1.1708503, 0.907136, 3.5594249, 1.1374011, -1.3826287] 数字。例外として、次のものを変更できます。 ケース1:スライスa np.random.seed(1) a = np.random.randn(9, 6).astype('float32') b = np.random.randn(6, 6).astype('float32') for i in range(1, len(a)): print(list(np.dot(a[:i], b)[0])) # full shape: (i, 6) [-0.9044868, -1.1708502, 0.90713596, 3.5594249, 1.1374012, -1.3826287] …