What does Vectorization do?
Makes Code shorter and run more efficiently
Abstractly how does Vectorization work?
Vectorization calculates f^ŵ,b(x-dash) by calculating the dot product of the two vectors.
Instead of counting w1x1 + w2x2 …. or looping over all elements the dot product uses parallelization for calculation
For example numpy.dot
More in deep how does Vectorization work
Time 0: calculates the product of all w[i] and x[i] -> in parallel
Time 1: Creates the sum of all pairs w[i] and x[i] -> using specialized hardware in parallel
What does Vectorization enable?
scaling to large datasets of machine learning algorithms
Explain an example for gradient descent using Vectorization
Assuming w-dash consists of i-elements, and the derivative d consists of i-elements
w-dash = w-dash - 0.1d-dash for all i elements
instead of a for loop you could write
w = w - 0.1 * d
which is then processed in one step in parallel