0%

21python广播机制

21 Python 的广播机制

21.1 Broadcasting example

【举例】

image-20231219163128440

image-20231219162824588

image-20231219162854686

【举例】

image-20231219163446396

21.2 General Principle

image-20231219163657817

21.3 Python-Numpy vectors

直接使用 np.random.randn(5),得到是秩为1的数组,最终将会运算得到一个值

image-20231219164100517

而是通常将其表达为 5*1的矩阵比较好,最终运算会得到一个矩阵

image-20231219164307491

image-20231219164514448