18. Broadcasting in Python
2023. 9. 8. 23:03ㆍGoogle ML Bootcamp/1. Neural Networks and Deep Learning
python matrix operation.
더하기,빼기,곱하기, 나누기(+ - * / ) : element-wise.
**중요 곱하기조차 행렬곱이 아닌 element-wise로 진행됨, np.dot(a,b)의 경우 행렬곱으로 진행**
- but (3,4) shape matrix + (1,4) shape matrix = (3,4) shape matrix
- 이때는 (1,4)를 행방향으로 복사하여 (3,4) matrix로 만든 후 element-wise 연산을 수행한다고 생각.
- (3,4) shape matrix + (3,1) shape matrix = (3,4) shape matrix
- 이때는 (3,1)를 열방향으로 복사하여 (3,4) matrix로 만든 후 element-wise 연산을 수행한다고 생각.
'Google ML Bootcamp > 1. Neural Networks and Deep Learning' 카테고리의 다른 글
20. Quick tour of Jupyter/iPython Notebooks (0) | 2023.09.08 |
---|---|
19. A Note on Python/Numpy Vectors (0) | 2023.09.08 |
17. Vectorizing Logistic Regression's Gradient Output (0) | 2023.09.08 |
16. Vectorizing Logistic Regression (0) | 2023.09.08 |
15. More Vectorization Examples (0) | 2023.09.08 |