Skip to main content
Luxara Academy

Archive — one question answered

What is a vector in deep learning?

Why does every neural network input get packed into one numeric vector?

A vector is an ordered list of numbers. In deep learning, every example — a flattened image, a sentence turned into token indices, or three spam indicators — is stored as a vector x∈Rd\mathbf{x} \in \mathbb{R}^d.

Concrete case: an email has x1=2x_1 = 2 promotional words, x2=0x_2 = 0 links, and x3=1x_3 = 1 for an unknown sender. Pack them as x=(2, 0, 1)\mathbf{x} = (2,\,0,\,1) with fixed length d=3d = 3. The network always expects exactly three numbers in the same order; permuting the entries changes the meaning.

In Python:

python
x = [2, 0, 1]
assert len(x) == 3

Matrix multiplication — a Linear layer in PyTorch — is defined on this column vector: z=Wx+b\mathbf{z} = \mathbf{W}\mathbf{x} + \mathbf{b}. Without vectorization, heterogeneous form fields force hand-written loops per feature, which wastes GPUs and breaks batch training.

So a vector is not decorative jargon. It is the standard way to turn every input into one mathematical object so a neural net can process thousands of examples in parallel.