seegongsik
Saved words
Engineering Mathematics

Tensors Are the Ladder Beyond Numbers, Vectors, and Matrices

Scalars, vectors, and matrices are the first rungs of the tensor ladder; the outer product makes rank-1 and a matrix is their sum

The word "tensor" sounds hard, but it just names a single ladder threading through things we already know. One cell is just a number (a scalar). Lay them in a line and you get a vector. Spread them into a grid and you get a matrix. Stack several grids and you get a cube. How many indices you need is exactly the rank: zero, one, two, three. The outer product u⊗v = u vᵀ multiplies two vectors outward to build the simplest rank-1 matrix, and any matrix can be assembled as a sum of such pieces (that was the SVD). A matrix can also eat two vectors and return one number, uᵀ M v. A single image, and a whole training batch, are tensors too. Let's climb the ladder one rung at a time.

Step the rank up one rung at a time with the buttons. Rank 0 is a single cell, just a number; you need no index to point at a spot. Rank 1 stretches the cell into a line and becomes a vector, and picking which cell takes one index. Rank 2 spreads the line into a grid and becomes a matrix, "which row, which column," so two indices. Rank 3 stacks those grids into a cube, so three indices. You can see at a glance that the rank is exactly the number of indices (axes). The shape grows along with it: point, line, sheet, volume. A tensor is not a new monster but a name that stands the things we know on the same ladder.

Now multiply two vectors outward to make a matrix. With the sliders, set u = (u1, u2) down the left and v = (v1, v2) across the top, and grid cell (i, j) holds ui · vj. That is u⊗v = u vᵀ. The number in each spot is the left value times the top value, and the cell is shaded dark or light by its value. Double u and a whole row doubles; raise v and a whole column rises. The striking thing is that however you turn the dials, this matrix's rank is always 1: every row is a multiple of u and every column a multiple of v, so there is only one independent direction. The outer product is the simplest matrix, a rank-1 brick.

So how do we build an ordinary matrix? Stack several rank-1 bricks. Add layers one at a time with the toggle. Layer 1 is only the first piece σ1·u1·v1ᵀ, so it roughly mimics just the big outline of the target matrix. Add layer 2 and σ2·u2·v2ᵀ fills in the remaining difference, so the sum matches the target matrix exactly. The view shows the current reconstruction beside the target and reports their difference as a number. This is the heart of the SVD: any matrix is A = Σ σk uk vkᵀ, a sum of rank-1 pieces, and keeping only the few largest σ still keeps most of the shape. Compression comes from right here.

You can see a matrix not as a "transform" but as a "machine that eats two vectors." Slot u in from the left and v from the right of a fixed matrix M and out comes one number: uᵀ M v. This is a rank-2 tensor (a matrix) acting as a bilinear form that takes two vectors and returns a scalar. Drag the u and v arrows on the coordinate plane. The readout below shows uᵀ M v live. Hold one fixed and double only the other and the result exactly doubles too. It is linear in each argument separately, hence "bilinear." Measuring length (the inner product), energy (½ xᵀ K x), curvature, stress: every quantity that eats two directions and gives one number fits this mold.

Finally, see why tensors are machine learning's native tongue. Add one axis at a time with the toggle. A single grayscale image is a grid of pixel brightnesses, an [H, W] matrix (rank 2). Go color and red, green, and blue channels stack into an [H, W, 3] cube (rank 3). Train on many images at once and you stack N of those cubes into [N, H, W, 3] (rank 4). The view shows, each time you add an axis, both the shape label and how the grids stack. A tensor is not abstract mathematical decoration but a practical container that holds data's several axes in one vessel. That is why a deep-learning framework carries "Tensor" in its name.

In PracticeA tensor is a name that stands numbers, vectors, matrices, and cubes on one ladder. The count of indices (axes) is the rank: scalar = 0, vector = 1, matrix = 2, cube = 3. The outer product u⊗v = u vᵀ fills cell (i,j) with ui·vj to make the simplest rank-1 matrix, and any matrix is A = Σ σk uk vkᵀ, a sum of rank-1 pieces (that is the SVD, and keeping only large σ is compression). Used as a bilinear form, a matrix eats two vectors and returns one number, uᵀ M v, linear in each argument; the inner product, energy, and stress all fit this mold. Machine learning's data is wholly tensors: a grayscale image [H,W], color [H,W,3], a batch [N,H,W,3]. Climb one rung at a time from number to vector to matrix to cube and the whole of linear algebra appears as one ladder.
Engineering Mathematics
Was this helpful? Support seegongsik