|
|
|
|
|
by cs702
1751 days ago
|
|
Every element of a matrix multiplication is a dot-product of two vectors. The dot-product of two vectors quantifies their similarity -- in fact, we call it "dot-product similarity" in a nearest-neighbors context: If the dot product > 0, the vectors point in similar directions; if < 0, the two vectors point in dissimilar directions; if = 0, the two vectors are orthogonal. It's not too hard to imagine that it might be possible to learn representative K-means clusters of training vectors and then, at run-time, find similar vectors using an efficient hashing scheme and do the equivalent of a table lookup to get the approximate dot-product similarity scores -- without having to perform any multiplications. This isn't quite correct (I'm oversimplifying and ignoring many important details), but I think it's a helpful mental image. Very clever stuff. |
|
To make it more explicit, dot product of two vectors is just cosine of the angle between them, multiplied by their lengths.