Vectors and matrices

⟨x,y⟩\langle \mathbf{x}, \mathbf{y} \rangle Inner product (angle brackets)

The inner (dot) product of two vectors: multiply matching entries and add.

In ML papers

⟨x,y⟩=∑ixiyi=x⊤y\langle \mathbf{x}, \mathbf{y} \rangle = \sum_i x_i y_i = \mathbf{x}^\top \mathbf{y} for ordinary vectors. Angle brackets are the general notation, so the same symbol covers kernels' feature-space products and the matrix inner product ⟨A,B⟩=tr⁡(A⊤B)\langle A, B \rangle = \operatorname{tr}(A^\top B). Attention scores and cosine similarity are inner products.

How to type it

LaTeXShows
\langle \mathbf{x}, \mathbf{y} \rangle⟨x,y⟩\langle \mathbf{x}, \mathbf{y} \rangle

A worked example

⟨(1,2),(3,4)⟩=3+8=11\langle (1, 2), (3, 4) \rangle = 3 + 8 = 11

Equations that use it

Related

a⋅b\mathbf{a} \cdot \mathbf{b}Centre dotx⊤y\mathbf{x}^\top \mathbf{y}Transpose∥x∥2\|\mathbf{x}\|_2Norm

Decode this example →