Vectors and matrices

x∈Rd\mathbf{x} \in \mathbb{R}^{d} Bold lowercase (vector)

A bold lowercase letter is a vector: a list of numbers.

In ML papers

The usual convention: bold lowercase = vector, bold uppercase = matrix (Bold uppercase (matrix)), plain italic = a single number (scalar). So x\mathbf{x} is an input vector, h\mathbf{h} a hidden state, w\mathbf{w} a weight vector, and xix_i (not bold) one entry of x\mathbf{x}. Greek vectors are bold too: μ\boldsymbol{\mu}, θ\boldsymbol{\theta}. Vectors are column vectors unless a paper says otherwise.

Other meanings, by context

How to type it

LaTeXShows
\mathbf{x}x\mathbf{x}
\boldsymbol{x} bold italic, also for Greekx\boldsymbol{x}
\vec{x} arrow stylex⃗\vec{x}

A worked example

x=(123)∈R3,x2=2\mathbf{x} = \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} \in \mathbb{R}^3, \quad x_2 = 2

The vector is bold; its entries are plain.

Common confusions

Equations that use it

Related

W∈Rm×n\mathbf{W} \in \mathbb{R}^{m \times n}Bold uppercase (matrix)xi,  Wq,  pθ,  dmodelx_i,\; W_q,\; p_\theta,\; d_{\text{model}}Subscript (index or label)W∈Rd×kW \in \mathbb{R}^{d \times k}Real numbers (ℝ) and shapesx⊤y\mathbf{x}^\top \mathbf{y}Transpose

Decode this example →