A Visual Guide To Broadcasting In Numpy
Introduction Broadcasting Vector-Scalar Example Matrix-Vector Example Matrix-Matrix Example Array Shapes Broadcasting in multiple dimensions K-Means Clustering Example Conclusion Introduction I recently took the excellent course on Machine Learning with Python from MIT. In one of the forums somebody asked about how to perform calculations of the expectation maximization (EM) algorithm without for loops. I wrote an answer about how broadcasting can be implemented in numpy to perform vectorized operations that simplify and speed up execution of the code.
[Read More]