Vectorization Flashcards

(6 cards)

1
Q

What does Vectorization do?

A

Makes Code shorter and run more efficiently

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Abstractly how does Vectorization work?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

More in deep how does Vectorization work

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does Vectorization enable?

A

scaling to large datasets of machine learning algorithms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain an example for gradient descent using Vectorization

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly