Data science/Python

Numpy matrix operation (dot, matmul, multiply) 설명

연금(Pension)술사 2021. 4. 6. 17:02

a @ b: PEP465에서 권장(matrix multiplication). 

np.dot(a, b): numpy에서 사용을 권장하지 않음.

np.matmul: Matrix multiplication 

다 내적

e.g) shape (3, 2) x shape (2, 4) => (3, 4)

 

A * B: 

element wise multiplication 와 matrix multiplication 둘다 지원함

multiplication

matrix인 경우와 arrayt인 경우 다름

 

blog.finxter.com/numpy-matmul-operator/

 

반응형