Learn Before
Formula

Cosine Similarity

For vectors x,yRd\mathbf{x}, \mathbf{y} \in \mathbb{R}^d, their cosine similarity is defined as the cosine of the angle between them. This metric is computed using the formula xyxy[1,1]\frac{\mathbf{x}^\top \mathbf{y}}{\|\mathbf{x}\| \|\mathbf{y}\|} \in [-1, 1] and serves as a fundamental method to mathematically express the similarity between vectors.

0

1

Updated 2026-05-24

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L