x∈Rx \in \mathbb{R}

Scalar — one number

A single number, with no axes. The loss, the learning rate and the temperature are scalars. Written as a plain italic letter, such as x.

A scalar has no axes: there is nothing to index, because there is only one value. Writing x∈Rx \in \mathbb{R} says xx is one real number.

In PyTorch a scalar is a tensor of shape (), an empty shape. Multiplying a vector or matrix by a scalar scales every entry by the same amount.

Example

T=0.7η=0.001L=2.31T = 0.7 \quad \eta = 0.001 \quad \mathcal{L} = 2.31

A temperature, a learning rate and a loss: each is one number.

Where the course uses it

Related terms