Python and Vectorization
Vectorization - Vectorizing Logistic Regression's Gradient Descent
feature이 여러 개 있다고 했을 때, iteration을 이용해 derivative를 구하는 것보다 vector형태로 만들어 python numpy의 method를 사용하는 것이 유리하다.
모든 게산을 해주어야 하는 것은 똑같지만 하드웨어, 소프트웨어적으로 해당 계산이 최적화되어 있기 때문에 계산속도가 월등히 빠르다.
Broadcasting in Python
Broadcasting — NumPy v1.23 Manual
The basic operation of vector quantization calculates the distance between an object to be classified, the dark square, and multiple known codes, the gray circles. In this simple case, the codes represent individual classes. More complex cases use multiple
numpy.org
numpy로 행렬을 다룰 때, broadcasting은 코드를 덜어주는 아주 좋은 기능이다.
A Note on Python/Numpy
rank 1 array는 피해라.
'Google Machine Learning Bootcamp 2022 > Neural Networks and Deep Learning' 카테고리의 다른 글
4. Deep L-layer Neural Network (0) | 2022.07.04 |
---|---|
3. Shallow Neural Networks (0) | 2022.07.02 |
2. Neural Networks Basics #1 (0) | 2022.06.28 |
1. Introduction to Deep Learning (0) | 2022.06.24 |
댓글