Cosine similarity is the cosine of the angle between two vectors / the normalized dot product (divided by vector norms).


Identical relationships:
Orthogonal relationships:
Opposite relationships:
The inverse of cosine similarity is called cosine distance and is in the range .

EXAMPLE

Transform datapoints (e.g. word counts) into a vector.


Used in Content-based-addressing for computing attention (ML) scores (similarity of keys and values) for Neural Turing Machine

References

Explanation