Vectorize using linear algebra and NumPy to make your Python code fast
summary
Shows how to replace Python loops and list-heavy implementations with NumPy vectorized operations to speed up code, using concrete linear-algebraic tricks. Begins from an inefficient algorithm implemented with loops, then iteratively replaces bottlenecks with NumPy operations while explaining the linear algebra reasons for the performance gains.
AI-written summary · about
chapters (7)
- 0:00Start
- 2:46What is a vector?
- 4:47What is a matrix?
- 5:11Representations in NumPy
- 7:08Manhattan distance
- 15:12Getting rid of the nested for loop
- 15:58Doing the matrix subtraction in one pass
related talks
35mVectorization: How slow Python runs fast code
38mVectorize all the things! Using linear algebra and NumPy to make your Python code lightning fast
34mNumPy: vectorize your brain
27mAPL-Inspired Techniques for Advanced NumPy
14mSynthesizing Vectorized Code via Verified Lifting
35mThe "NumPy" Approach
01h 27mMaking computation easier with cool Numpy tricks
40mSpeed Without Drag
