Sets, shapes and definitions

W∈Rd×kW \in \mathbb{R}^{d \times k} Real numbers (ℝ) and shapes

The real numbers. ℝⁿˣᵈ is the set of n × d arrays of reals: it states a shape.

In ML papers

R\mathbb{R} is the set of real numbers. With a superscript it gives a shape: x∈Rd\mathbf{x} \in \mathbb{R}^d is a vector of dd numbers, W∈Rd×kW \in \mathbb{R}^{d \times k} a dd-by-kk matrix, X∈RB×T×dX \in \mathbb{R}^{B \times T \times d} a three-dimensional tensor. Reading these declarations is the quickest way to check that a formula's products line up.

Other meanings, by context

How to type it

LaTeXShows
\mathbb{R}R\mathbb{R}
\mathbb{R}^{n \times d} with a shapeRn×d\mathbb{R}^{n \times d}

A worked example

A∈R2×3, x∈R3  ⇒  Ax∈R2A \in \mathbb{R}^{2 \times 3},\ \mathbf{x} \in \mathbb{R}^{3} \;\Rightarrow\; A\mathbf{x} \in \mathbb{R}^{2}

The inner dimensions (3 and 3) must match; the outer ones give the result's shape.

Common confusions

Equations that use it

Related

x∈Rd\mathbf{x} \in \mathbb{R}^dElement ofRn×d\mathbb{R}^{n \times d}Times (cross)W∈Rm×n\mathbf{W} \in \mathbb{R}^{m \times n}Bold uppercase (matrix)x∈Rd\mathbf{x} \in \mathbb{R}^{d}Bold lowercase (vector)

Decode this example →