A vector is a list, and an arrow
A vector is just an ordered list of numbers, like (3, 1.4). You can
read it as an arrow from the origin to that point, with a direction
and a length.
This matters because in machine learning almost everything is a vector: a data point,
a word, an image, a prediction. They are all lists of numbers pointing somewhere in
space.
Length, or magnitude
The length of a vector, written |a|, is how far its arrow reaches,
found with the Pythagorean theorem. It often stands in for "how big" or "how strong"
something is, like the size of an error or the strength of a signal.
The dot product measures alignment
The dot product takes two vectors and returns one number that says how much they point the same way:
a · b = |a| |b| cosθ
Same direction gives a big positive number, a right angle gives exactly
zero, and opposite directions give a negative number. Nearly every
"score" a neural network computes is a dot product underneath.
Try it: drag the two arrows above until they are perpendicular and watch a·b fall to zero.
Projection is a shadow
The dot product also gives the projection: how much of one vector
lies along another, like the shadow it casts. That "how much of a points along b" idea
is the heart of similarity search and of the attention used in modern language models.
A matrix transforms space
A matrix is a rule that moves every point in space at once. The
simplest way to read a 2×2 matrix: its two columns tell you where the two unit
arrows, right and up, end up. Every other point follows along, so the whole grid
rotates, stretches, or shears as one piece.
A neural network layer is exactly this: multiply the data by a matrix to rearrange it into something more useful, then repeat.
Try it: open the "Matrix as a transform" tab above and drag the sliders to bend the grid.
The determinant: how much space stretched
One number, the determinant, summarizes how much a matrix scales
area. Above 1 it expands space, between 0 and 1 it shrinks it, and a negative value
means space got flipped over like a mirror. A determinant of zero means the transform
squashed everything flat and lost a dimension.