Agreement
One number that says how much two lists agree — it measures angles, casts shadows, points the gradient, and finally decides what a transformer pays attention to.
Every section of every unit ends with a realization — the formula turned into a sentence you could have written yourself. Here they all are, in order. Read it the night before an exam, or read it first to see where the road goes.
A handful of ideas keep coming back, each time in bigger clothes. Follow one from its first appearance to the place where it runs a real machine.
One number that says how much two lists agree — it measures angles, casts shadows, points the gradient, and finally decides what a transformer pays attention to.
Eigenvectors keep turning up: they unpack a matrix, judge a landscape, explain why a valley is slow, and name the directions that matter in data.
Some inputs vanish without a trace. The blind spot of a matrix explains missing solutions, redundant features and why a model can memorise.
The chain rule, promoted step by step: a product of slopes, a product of Jacobians, a sweep backwards through a graph — and later, through time.
Curvature decides everything near a flat spot — how good an approximation is, whether you found a minimum, and how big a step you can dare.
One rule — step against the gradient — then every refinement of it: how far, how often, with how much memory.
Positive definite matrices are the “honest bowls” of the course: they define rulers, have a square root, certify a minimum and make a problem safe to solve.
Click any title to open that exact section.
Up close, every smooth curve is a straight line. The error of pretending shrinks like the square of how far you look. So we can study the easy, straight version and trust the answer nearby.
In one sentence: almost everything looks straight when you zoom in, so linear equations are the tool machine learning reaches for first.
A vector is not a mysterious arrow. It is a list of numbers you are allowed to add and scale. Houses, photos, words and shopping slips all follow the same two rules, so one set of tools works on all of them. That is why linear algebra powers machine learning.
In one sentence: a vector is an ordered list of numbers that you can add slot by slot and scale, and almost any data can be written that way.
Everything fancy in this unit (matrices, Gaussian elimination, echelon form) is just these two moves, done by a machine at scale: remove an unknown by subtracting rules, then substitute back.
One more thing: four rules for three unknowns usually have no answer at all. This one does because the rules happen to agree. When real data disagrees, which is the everyday case in machine learning, linear regression finds the best almost-answer instead.
In one sentence: a system of linear equations is a set of rules that must all be true at once, and you solve it by subtracting rules to remove unknowns one at a time.
A linear system never has exactly two answers. Suppose and are both answers. Then the point halfway between them is an answer too, and so is every point on the line through them. Two answers always grow into infinitely many. So the only possible counts are zero, one, or infinity.
In one sentence: each equation is a straight line (or flat plane), and they can meet nowhere, at one point, or along a whole line, so a system has zero, one or infinitely many solutions.
A matrix is a function, and multiplying matrices means doing one function after another. "Blur, then darken" is one combined filter, and that filter is (read right to left: acts first). The strange row-times-column rule is exactly the arithmetic that makes true.
That is also why order matters. Socks then shoes is not shoes then socks. In general .
In one sentence: a matrix is a grid of numbers, and multiplying two matrices means "row times column" for every cell, which is the same as doing one filter after another.
Rows give you rules to obey. Columns give you ingredients to mix. The machine view asks which input made this output. Three pictures, one equation. And the big questions (is there an answer? just one?) belong to the machine itself, not to the particular you happen to be holding.
In one sentence: Ax = b can be read as rules to obey (rows), ingredients to mix (columns), or a machine to run backwards, and switching windows is the key skill of linear algebra.
The columns of a matrix are where î and ĵ land. Once you know those two landing spots, you know where every point goes: . And is the area of the tile those two arrows make: how much the machine grows or shrinks area, with a minus sign if it flips space over.
In one sentence: a matrix moves space by sending î and ĵ to its columns, and its determinant is how much it scales area (or volume), with det = 0 meaning space got squashed flat.
The inverse exists exactly when , because you cannot un-squash something that was squashed flat. And even when it exists, a determinant close to zero makes the inverse huge and the answer shaky. In practice we solve with elimination and never build .
In one sentence: the inverse is the undo button for a matrix; it exists only when det A is not zero, and in real work we solve with elimination instead of computing it.
all solutions = one solution + every "invisible" direction
The invisible directions are the arrows the matrix sends to zero: solutions of . Together they are called the null space of . You will meet "one answer plus the null space" again in regression, in optimization, and inside neural networks.
In one sentence: when a system has infinitely many solutions, they all look like one particular answer plus any mix of the directions the matrix sends to zero.
solutions of = + all of
One anchor, plus the whole blind spot. If the blind spot is only , there are no look-alikes, and a solution (when there is one) is unique. You already know that case by its other names: , invertible.
In one sentence: the null space holds every input the matrix sends to zero, and adding any of them to a solution gives another solution, which is why answers come in families.
Elimination rewrites the same problem until the answer is obvious. Every move can be undone, so the solutions never change. At the end, the staircase tells you everything: pivot columns are pinned-down unknowns, columns without a pivot are free, and a row that says something non-zero means no solution. In the big example the last row became "", so there is a solution only when .
In one sentence: Gaussian elimination uses swap, scale and add-a-multiple to turn the augmented matrix into a staircase, without ever changing the solutions, and the staircase then shows the answer and the system's fate.
In RREF, every pivot column is a clean "1 and zeros" column, so the answer can be read straight off the bar. Every column without a pivot is a free variable, and each one gives exactly one invisible direction. So the size of the null space is
unknowns minus pivots: freedom left over = unknowns minus the rules that really pin something down. (This is the rank–nullity theorem.)
In one sentence: RREF keeps eliminating until every pivot is a lone 1, so solutions, null-space directions and even the inverse can be read straight off the page.
Rank answers "how many solutions?" completely. Compare with and with , the number of unknowns:
① At least one solution . Adding brought no new direction, so is in the column space.
② Exactly one ① holds and : no free variables.
③ Infinitely many ① holds and : free variables exist, and the null space is alive.
In one sentence: rank is the number of pivots, the number of truly independent rows and of columns, and comparing rank(A), rank([A|b]) and n tells you whether a system has zero, one or infinitely many solutions.
One picture: a matrix is a machine that moves space; solving asks which input the machine turned into that output. One method: elimination on until the staircase appears. One number: rank, which counts the dimensions that survive and decides all three fates.
In one sentence: a matrix moves space, elimination reveals what it did, and rank tells you whether Ax = b has zero, one or infinitely many answers.
In one sentence: every object in machine learning is a list of numbers, and this unit maps the world those lists live in and the rules for moving around it.
A group is a set with a trustworthy undo button. You can combine any two members and stay inside, brackets never matter, there is a do-nothing member , and every has a partner that brings you back to .
When a set fails, it is nearly always the last promise. The counting numbers have no . The whole numbers under multiplication have no .
In one sentence: a group is any world where combining keeps you inside and every move can be undone.
Adding and scaling can be done in either order, and you never leave the world. Anything you can add and scale by these rules counts as a vector. Every "linear" idea in this course, from gradients to averages, is this route-swapping trick.
In one sentence: a vector space is any world where you can add and scale freely and never fall off the board.
In , the subspaces are exactly the flat things through the origin: the origin alone, lines through , planes through , and so on up to the whole space. A set that is shifted, curved or fenced in always lets something escape.
This is a theorem, not just a pattern. Sections 10 and 11 show why: every subspace is the span of a few independent arrows, and such a span is always a flat through .
In one sentence: a subspace is a flat world through the origin where adding and scaling never take you outside.
Zero in, zero out. Invisible plus invisible is invisible, and a stretched invisible change is still invisible. So the null space is always a subspace. The same two rules make the column space , all the outputs the machine can produce, a subspace too.
But the solutions of with are never a subspace: two of them add up to , not .
In one sentence: whatever a matrix cannot see forms a subspace, because zero plus zero is zero and a stretched zero is still zero.
The span is every mix . It is always a flat through the origin, so it is always a subspace: a point, a line, a plane, or more.
Its size depends on how many different directions the arrows point in. A new arrow that lies inside the current span adds nothing. An arrow that points out of it adds a whole new direction.
In one sentence: the span is everywhere your arrows can take you, and it only grows when a new arrow points somewhere new.
Vectors are independent when the only way to make is with every . You can only get home by never leaving.
If some other weights bring you home, the set is dependent, and at least one vector is a mix of the rest: extra baggage.
In one sentence: vectors are independent when the only walk that brings you home is the one where you never leave.
Stack the vectors as columns and eliminate. A pivot column brings a new direction. A column without a pivot is a mix of earlier columns, and in the reduced form its numbers are the exact recipe.
The number of pivots, the rank, is the number of truly different directions. If every column has a pivot, the vectors are independent.
In one sentence: eliminate the columns, and every column without a pivot is exposed as a mix of the pivot columns before it.
If the ingredients are independent, then the dishes are independent exactly when their recipe cards are. So you can always do the check on the small, simple cards instead of the big dishes.
And more cards than ingredients () always means dependent.
In one sentence: with independent ingredients, dishes are independent exactly when their recipe cards are, so you can always check the cards instead.
A basis reaches everything with nothing extra. Because of that, every vector has exactly one address:
The are the coordinates. Change the basis and the address changes, but the point itself stays put. A dependent pair cannot be a basis: the graph paper collapses to a line.
In one sentence: a basis is a set of directions that reaches everything with nothing to spare, so every vector gets exactly one address.
Every basis of a space has the same number of vectors. That number is the dimension: the count of independent directions, the number of knobs you really have.
Components count the room you are written in. Dimension counts the room you actually use. And more vectors than the dimension always means redundancy.
In one sentence: dimension is the number of independent directions a space really has, and every basis agrees on it.
To find a basis of a span: stack, reduce, and keep the original vectors in the pivot columns. The number you keep is the dimension.
For the slide example: a basis of is , and . Four vectors walked in, one was a mix, and three genuine directions remain.
In one sentence: to shrink a pile of vectors to a basis, keep each vector only if it points outside the span of the ones you already kept.
In one sentence: know your space, spot the redundancy, find the span, and pick the smartest basis.
In one sentence: machine learning keeps asking "how similar are these two things?", and this unit is about the rulers that answer it.
A norm is just a rule for measuring length. Different rules give different shapes of "all points at distance 1": a circle for the crow, a diamond for the taxi. When a machine-learning model measures error or closeness, it has quietly picked one of these rules, and the pick changes the answer.
In one sentence: a norm is any rule for length that scales properly, allows no shortcuts, and gives zero only to "nowhere".
The dot product is an agreement score. Every "people like you also watched…" system is built on this one line of arithmetic.
In one sentence: multiply matching entries and add them up; the total says how much two lists agree, and a list's agreement with itself is its length squared.
Any score with these three ingredients is called an inner product. The dot product is just the most famous one. Every inner product gives you its own length, its own distance and its own angle, and they all behave sensibly. The natural next question: how do we cook up new ones? (Next section.)
In one sentence: an inner product is any agreement score that is fair with sums, the same both ways, and always positive for a list with itself.
The matrix reshapes the unit ball. The identity gives a round ball. A diagonal squashes it into an egg along the axes. Off-diagonal numbers tilt the egg. A matrix that is not positive-definite tears the ball open, because some arrows would get a negative length squared.
In one sentence: to design a ruler, pick a symmetric matrix that gives every non-zero arrow a positive length squared, and test it with the top-left number and the determinant.
A shadow never beats the stick, and a detour never beats the straight road. The first fact makes angles possible (next section). The second fact makes sure every inner product gives a proper length.
In one sentence: length and distance come free with every inner product, and the score can never beat the product of the lengths, just as a shadow can never beat the stick.
is the shadow of a length-1 arrow. Shrink both arrows to length 1, then drop the shadow of one onto the other: its length is . Full shadow: same direction. No shadow: right angle. Negative shadow: opposite. Length never enters. Only direction does.
In one sentence: cosine similarity is the agreement score with the lengths divided out, so it measures direction only: +1 same, 0 unrelated, −1 opposite.
In 2D, two random arrows can point any which way. In 1000D, two random arrows are almost always at almost exactly 90°. The spread of the cosine shrinks like : about 0.03 when .
Why this matters: a 1000-number embedding space has room for millions of ideas that barely get in each other's way. It also means a cosine of 0.3 between two real embeddings is huge. Random chance would give about 0.
In one sentence: in many dimensions, random arrows are almost always at right angles, so real similarity stands out clearly.
"At a right angle" is not a fact about two arrows alone. It is a fact about two arrows and a ruler. Measuring with is exactly the same as stretching the page sideways by and then measuring normally. Choosing the ruler to fit the problem is what feature weighting and the Mahalanobis distance do in machine learning. (Section 5's lens shows the same thing: press diag(2, 1).)
In one sentence: change the ruler and the same two arrows can stop being at a right angle.
This one line is the test for an honest motion. Pass it, and every length, distance and angle is safe. The shear keeps the area (its determinant is 1), but it fails this test, and you can see its arrows slide off the measuring rings.
In one sentence: a matrix with turns or flips space like a stiff tile, so every length and angle survives.
Any arrow = its shadow along a direction + a leftover at a right angle. The shadow amount is . If the stick leans backwards (angle past 90°), turns negative and the shadow falls behind you. This single split is the heart of least squares, attention scores and PCA.
In one sentence: to find a shadow, ask for the leftover to be at a right angle, and the amount comes out as .
Gram–Schmidt = cut off the shadows, then resize to 1. Each new direction loses the parts that point along the clean ones, so what is left must be at a right angle to them. Any basis at all can be cleaned this way.
In one sentence: Gram–Schmidt turns any crooked basis into a square one by cutting off shadows and resizing to length 1.
In one sentence: a matrix moves everything, but it has simple fingerprints: one number for how much it grows space, and special directions it only stretches.
is the area of the tile that the unit square becomes. Its size says how much every area grows. A minus sign means the tile was flipped over. Zero means it was squashed flat, and then nothing can undo .
In one sentence: the determinant is the signed area of the tile the unit square becomes: its size is the growth, a minus means flipped, and zero means squashed flat for good.
A big determinant is a sum of small ones: entry × sign × minor, along any row or column. Pick the line with the most zeros. For big matrices, eliminate down to a triangle and multiply the diagonal. Every road gives the same number.
In one sentence: break a big determinant into small signed pieces along the laziest line, or eliminate to a triangle and multiply the diagonal.
is the sum of the diagonal. It ignores everything off the diagonal, and always. Soon you will see it is also the sum of the eigenvalues.
In one sentence: the trace adds up the diagonal, ignores the order of a product, and turns out to be the sum of the eigenvalues.
An eigenvector is an arrow that only stretches: . The stretch number is its eigenvalue. To test a guess, multiply once and check if the answer is a multiple of the arrow.
In one sentence: an eigenvector is a direction the matrix only stretches, and its eigenvalue says by how much: .
An eigenvalue is a setting of the dial where squashes space flat. Solve this equation for the eigenvalues, then solve for the directions. Check: sum = trace, product = determinant.
In one sentence: eigenvalues are the values of where ; they always add up to the trace and multiply to the determinant.
A symmetric matrix is: turn into the grain, stretch each grain direction by its , turn back. Its eigenvalues are real, its eigen-directions are at right angles, and undoing is just flipping it.
In one sentence: every symmetric matrix has a hidden right-angle grain, so it is just turn, stretch along the grain, turn back: .
A symmetric 3×3 matrix turns the round ball into an egg. The egg's axes are the eigen-directions, their lengths are the 's, and the volume grows by .
In one sentence: in 3D a symmetric matrix squeezes the ball into an egg along three right-angle axes, and the volume grows by the product of the three eigenvalues.
A pure turn has no real eigen-directions. Its eigenvalues are the twins , which sit on the unit circle. The angle of is the turn, and the size of is the stretch.
In one sentence: a matrix that turns has no real eigen-directions, and its complex eigenvalues are the turn written as a number.
Fill in from the top-left corner, one entry at a time. It only works when is positive-definite, so it doubles as a test. And bends a round random cloud into one with covariance .
In one sentence: a positive-definite matrix has a triangular square root , found corner by corner, and is exactly the lens that turns plain random numbers into realistic data.
Different eigenvalues, or a symmetric matrix, guarantee a full set of eigen-directions. A repeated eigenvalue in a non-symmetric matrix can come up short (). And the data matrix is always in the safe, symmetric, positive-definite club.
In one sentence: only non-symmetric matrices with repeated eigenvalues can run short of eigen-directions, and the data matrix never does.
A matrix looks like a block of numbers. Underneath, it is a short list of simple moves. Writing does not change at all. It only lets you see what does.
In one sentence: a decomposition rewrites a matrix as a few simple moves — turn, resize, turn — without changing what it does.
A diagonal matrix is a resize tool: one handle per axis. Repeating, undoing and measuring area all work one number at a time: . The only danger is a handle set to 0 — that axis is flattened for good.
In one sentence: a diagonal matrix is easy because each axis minds its own business — so this unit is a hunt for the diagonal hiding inside every matrix.
says: in its own favourite directions, is just a resize tool. The columns of are those directions (the eigenvectors). The diagonal of says how much each is stretched (the eigenvalues).
In one sentence: just says: put 's eigenvectors in the columns of and their eigenvalues in .
A symmetric matrix is an equalizer. It splits the input along directions at right angles, turns each part up by its own , and adds them back: . Undoing the split is free, because .
In one sentence: a symmetric matrix is a set of perpendicular directions, each turned up by its own eigenvalue — nothing more.
is a translator: into the matrix's own directions, resize, and back. Its best trick is repetition: . Powers of a matrix become powers of plain numbers.
In one sentence: translates into the matrix's own language, does a simple resize there, and translates back.
An eigenvector is a direction the matrix does not turn. Eigendecomposition needs independent ones for an matrix. The shear has one, the rotation has none, and a rectangular matrix cannot even ask the question.
In one sentence: eigendecomposition fails whenever one set of axes must serve both input and output — the shear, the rotation, and every rectangular matrix.
Every matrix is turn · resize · turn: . There are two frames at right angles — for inputs, for outputs — and a list of stretches . No exceptions: not rotations, not shears, not rectangles.
In one sentence: every matrix is turn · resize · turn — , then , then — no exceptions.
To find the SVD, take the round trip. The eigenvectors of are the input frame , and . The output frame comes free: . always has the same shape as , padded with zeros.
In one sentence: to break down , break down the symmetric round trip instead: and the σ's fall out, and finishes the job.
A rectangular matrix maps one world into another. A matrix can only fill a flat sheet inside 3-D space. The SVD's span that sheet, and is the direction it can never reach.
In one sentence: a rectangular matrix maps one world into another: its image is a flat slice of the bigger world, and is the direction it can never reach.
Sort the layers biggest first and keep the top : . No rank- matrix does better, and the error is . Each layer costs only numbers — so this is compression, for photos and for tables of ratings alike.
In one sentence: sort the layers biggest first and keep the top few — the best possible summary of any matrix, whether it is a photograph or a table of tastes.
is the biggest boost a matrix can give: . The ratio says how uneven the boosts are. When it is huge, undoing the matrix blows up tiny errors.
In one sentence: is the loudest a matrix can ever be, and says how uneven its boosts are.
Every matrix is turn · resize · turn. Sort the stretches biggest first and keep the top few, and you have the best short summary a matrix can have. Photo compression, noise removal, PCA and recommenders are all that one move.
In one sentence: find the two frames and the sorted stretches, and any matrix becomes simple enough to read, repeat, undo and compress.
The slope tells you which way is up. So you step the other way. Slope positive? Step left. Slope negative? Step right.
Here (read it: "L-prime of w") is the slope where you stand. (read it: "eta") is a small number that sets your step size. The minus sign is the "go the other way" part.
In one sentence: training is walking downhill in fog: you cannot see the valley, but you can always feel the slope under your feet, and that is enough.
The derivative is rise ÷ run between two points, as the two points squeeze into one. It never divides by zero. It only asks what the ratio gets close to.
In one sentence: the derivative is the slope of a two-point line as the two points squeeze into one, and it exists exactly where the curve looks straight up close.
Machines in a row: their rates multiply. Work out the outer rate at the inner value, then multiply by the inner rate. A deep network is a long row of machines, so this one rule runs all of machine learning.
In one sentence: rates in a row multiply, and a deep network is a long row, which is why the chain rule runs machine learning.
Each term copies one more derivative at the anchor: first the value, then the slope, then the bend. Near the anchor the copy is excellent. Far away it can fail, so Taylor is a local promise.
In one sentence: a Taylor polynomial copies a function's value, slope, bend and more at one point, and the keeps the copies from disturbing each other.
Freeze every other input, then differentiate as usual. Each partial derivative is the slope of one slice through the landscape.
In one sentence: to take a partial derivative, freeze every other input and differentiate as usual.
The gradient points steepest uphill, and its length says how steep. So minus the gradient is steepest downhill. This one line, repeated, is how almost every model in machine learning is trained.
In one sentence: the gradient puts all the partial derivatives in one arrow: it points steepest uphill, its length is the steepness, and minus it is the direction of training.
Two rows of the table do almost all the work in machine learning. The gradient: the loss is one number and the weights are a list, so the derivative is a list shaped like the weights. That is why you can subtract it from them. The Jacobian: a layer turns a list into a list, so its derivative is a matrix.
In one sentence: count before you compute: one sensitivity per (output, input) pair, with outputs as rows and inputs as columns.
Row , column : how much output moves when input is nudged. Zoom in on any smooth map and it becomes this matrix.
In one sentence: the Jacobian is the matrix a curved map turns into when you zoom in close.
is the local area factor. Not zero means you can undo the map near that point. But being undoable near every point still allows the map to wrap around and repeat.
In one sentence: is the local area factor: non-zero means you can undo the map nearby, but not always everywhere at once.
The chain rule for lists is matrix multiplication, later layer on the left. Backpropagation just multiplies from the loss end, so it only ever carries a thin row.
In one sentence: backpropagation is the chain rule as matrix multiplication, done from the loss end backwards so that nothing bigger than a row is ever built.
The gradient says which way. The learning rate says how far to trust it. Too small and you crawl. Too big and you overshoot, again and again.
In one sentence: gradient descent is : the gradient picks the direction, and decides how far to trust it.
At a corner the two sides disagree, so there is no derivative. Software just picks a value in between. Rows versus columns is only a habit, but the order of matrix factors is a rule.
In one sentence: rows versus columns is a habit, the order of matrix factors is a rule, a corner has no derivative, and the giant four-way table is used but never stored.
If you keep one habit from this unit, make it counting shapes before computing anything. Outputs give rows, inputs give columns. A gradient has the same shape as the thing you differentiate by. In a product, the inner sizes must match. Most matrix-calculus mistakes are shape mistakes, and counting catches them before any algebra.
In one sentence: nudge, measure, divide, shrink: that one move, kept tidy with shapes, is all of differentiation for machine learning.
Training needs one slope per knob, at every step. So the real question is not "what is the slope?" but "how do we get a million slopes cheaply?"
Backpropagation is the answer: tiny steps, and blame sent backwards.
In one sentence: training needs the loss's slope for every knob at every step, and finding them one knob at a time would cost one run of the network per knob.
Any function, however scary, is a chain of easy steps. Forward, each step computes a value. Backward, each step receives a blame , starting from .
The blame that reaches at the far left is the answer .
In one sentence: write the function as a chain of easy steps; values flow forward, and blame flows backward from to every step.
Multiply along each route. Add the routes. Backprop does exactly this, and shares the work so that no route is walked twice.
In one sentence: backpropagation is two rules — multiply the small slopes along each path, add the paths — done so that no path is walked twice.
A derivative is a promise: "near here, the function is a straight line plus a leftover that fades fast". Chain two promises, and the slopes multiply. Let several routes run side by side, and their products add.
And one entry of a matrix product, , is both rules written at once.
In one sentence: a derivative is a "straight line plus fading leftover" promise; chaining promises multiplies slopes, side-by-side routes add, and row-times-column is both rules at once.
Set . Walk from right to left. At each value, add up (child's blame × child's small slope) over all its children.
One sweep, and every value in the graph — every input, every weight — holds its slope.
In one sentence: set , then let every value send each parent its own blame times a small slope — one right-to-left sweep prices every knob.
: the miss, times how steep the squash is. Every knob that feeds then gets times one number: for the weight, for the bias.
Step each knob against its slope, repeat, and the loss really falls. That is training, complete.
In one sentence: compute the blame once, and every knob feeding reads its slope off it — then step downhill and the loss really falls.
Through the squash, scale each neuron's blame by its own slope. Then weights get , biases get , and the layer below gets .
Repeat, layer after layer. That is the inner loop of all of deep learning.
In one sentence: scale the blame by each neuron's slope, then weights get , biases get , and the layer below gets — four lines, the inner loop of deep learning.
Dot product → the other vector. → the outer product . → , because appears twice.
When in doubt, count where the variable appears, and add one term for each appearance.
In one sentence: five recipes — dot product, outer product, the doubling and least squares — give almost every small slope a real model needs.
Every layer's slope is the same shared start, times one new factor. Carry that start — the blame — from the loss backwards, and each factor is used once.
So one backward sweep costs about as much as one forward pass, however many knobs there are.
In one sentence: all the layer slopes share one long start — carry it once, from the loss end, and the whole set costs a single sweep.
is the "flat Earth" version of near .
Its error grows like the square of the distance: twice as far, about four times the error. Every gradient-descent step leans on this promise.
In one sentence: is the best straight-line stand-in near — the promise every gradient-descent step relies on.
The nudge estimate's error is (curve error, shrinking like ) + (rounding noise, growing like ). So there is a best — about here — and even there the answer is off by about .
Autodiff has neither problem. Nudging survives only as a gradient checker: a quick test that a hand-written backward pass is right.
In one sentence: autodiff is exact like the paper method and cheap like one run of the program, which is why nudging survives only as a checker.
Blame flows backwards through the same graph that computed the value. Multiply along paths, add at forks, and reuse every shared piece. Then a million slopes cost one sweep.
In one sentence: loss.backward() is this unit run by a for-loop — one backward sweep through the graph hands every knob its slope.
A Taylor polynomial is a copy built from a few facts at one spot: height, slope, bend, and so on. Each extra fact keeps the copy close for longer. What we still need is a promise about how close.
In one sentence: a Taylor polynomial copies a curve's height, slope and bend at one spot, and this unit proves why that copy works and how far it can be trusted.
If a smooth trail starts and ends at the same height, it has a level spot in between: . All it needs is no gaps and no sharp corners. This one small fact will build the whole unit.
In one sentence: a smooth trail with the same height at both ends must be level somewhere in between, and a sharp corner cancels the promise.
Somewhere, the slope equals the average slope: . Rearranged, . That is the straight-line copy, made exact by one secret point.
In one sentence: somewhere on the way your instant speed equals your average speed, and written as a formula this is already a straight-line copy with no error.
Each Rolle step turns two zeros into one new zero, one derivative lower. If is zero at and flat to order at , the zeros pass all the way down: for some in between.
In one sentence: a function that is very flat at and zero at passes one zero down per derivative, until its -th derivative is zero somewhere in between.
Every smooth function is its copy plus one leftover term: , exactly. The leftover looks like the next term, measured at a secret point. And the whole proof is Rolle, used again and again.
In one sentence: make the gap flat at and zero at , run the Rolle ladder, and the leftover turns out to be the next term measured at a secret point.
You never need the secret point. If on the stretch, then . A worst case turns the exact leftover into a guarantee you can compute.
In one sentence: you never learn , but a worst-case size for the next derivative turns the leftover into a firm promise, .
Each new term is the previous one times . Once is bigger than , every step shrinks the term. So the series for , and can be trusted at every . For there is no factorial, and past it fails.
In one sentence: a MacLaurin series is Taylor at , and the series for , and always settle down because eventually grows faster than any .
Walk in a straight line and a landscape becomes a one-variable curve . Its bend is . Those three second slopes are the landscape's curvature, and they are where the Hessian is born.
In one sentence: along a straight walk the landscape is a one-variable curve, and its bend is where the Hessian comes from.
At a level spot, the height change after a small step is . If is always positive, it's a valley; always negative, a peak; both, a pass. The three second slopes at the spot decide which.
In one sentence: at a level spot the slope part is zero, so the bend alone decides whether you are in a valley, on a peak, or at a pass.
. It is the one-variable formula with each piece moved up a level: number, list, table. The step goes in once for the list and twice, like bread, for the table.
In one sentence: the Hessian packs the bends into a table, and the step sandwiches it, so many-variable Taylor reads exactly like the one-variable formula.
The Hessian is the judge. Work out : positive with is a bowl, positive with is an upside-down bowl, negative is a saddle. The eigenvalues say the same thing: they are the strongest and weakest bends, and .
In one sentence: the Hessian's discriminant, its corner determinants and its eigenvalues are three ways to read one verdict — bowl, upside-down bowl, or saddle.
Find every level spot. Work out the Hessian at each one, because it changes from place to place. Read , then . And when , the bends have run out of evidence, so look further.
In one sentence: find every level spot, judge each one with its own Hessian, and when admit that the bends cannot decide.
Near its bottom, a loss is its own quadratic clone. The Hessian's eigenvalues say how narrow the valley is, and so how hard plain descent will be. Its inverse turns the clone into Newton's one jump, , which is powerful but costly for millions of weights.
In one sentence: near its bottom a loss is its own quadratic clone, so the Hessian decides how hard training is, and its inverse gives Newton's one-jump step.
Every smooth function is, up close, a polynomial, and Taylor's theorem tells you exactly how far "up close" reaches. The leftover came from a ladder of level spots. In two variables, the bend part is a table, the Hessian, whose signs say whether a level spot is the bottom of a bowl. When a training run says it has found a minimum, this unit is how you can check.
In one sentence: Taylor copies a function near a point with a guaranteed error, and the Hessian in that copy judges every valley a learning machine finds.
Read it: new position equals old position, minus the stride times the uphill arrow at the old position. Take the arrow, turn it around, shrink it to your stride, and step. This one line is the picture you just played with, written in symbols.
In one sentence: learning is a walk in fog — feel the slope, step the other way, repeat — which works in any number of dimensions, but finds only the valley below where you started.
Wrongness is the sum of squared misses, . Its slope, , just says "move the line toward the points". If the misses are mostly positive, push the line up.
In one sentence: say what "wrong" means, and a landscape appears by itself — one height for every setting of the knobs — with a slope that says which way the line should move.
The walk stops where the slope is zero, . The bend decides what kind of stop it is: is a valley, is a hilltop. And the valley you reach is the one below your start, not always the deepest.
In one sentence: the walk stops on level ground; the bend tells a valley from a hilltop or a saddle; and you land in the valley below where you started.
The rule is . On a bowl the slope is a spring, , and the bottom is . A trench has one stiff spring and one soft one, so a single stride bounces across it while crawling along it.
In one sentence: on a bowl the slope is a spring, ; a trench has a stiff spring and a soft one, so one stride bounces across it while it crawls along it.
Each step multiplies the distance to the bottom by . Keep that between and , which means . With many directions, the stiffest one () sets the limit for all, and the softest one sets how slowly you crawl.
In one sentence: each step multiplies the distance to the bottom by , so keep — and the gap between the stiffest and softest directions is what makes the walk zig-zag.
Line search fixes the direction , then slides to the bottom of . At the best stride, the new slope is at a right angle to the step. On a bowl, that stride is .
In one sentence: slide along the downhill line until the ground stops dropping — there the new slope is at a right angle to your step — and on a bowl the best stride is .
Trap the bottom in a bracket and squeeze. Halving leaves width after rounds; golden cuts shrink it by per round and reuse a probe. Or skip the hunt: Armijo accepts any stride with .
In one sentence: when there is no formula for the best stride, trap it in a bracket and squeeze — or, like real training, take Armijo's "good enough" stride.
Start bold, finish careful. On a clock: , , or divide by a constant every few epochs. By feel: the bold driver multiplies the rate by after a good step, and undoes and halves after a bad one.
In one sentence: the learning rate is a speed that should drop as you near the bottom — on a timer (exponential, inverse, step) or by feel (the bold driver).
To audit a slope, nudge and divide. Forward, , is off by about . Central, , is off by about . So use central, with a small but not tiny .
In one sentence: check a coded slope by nudging a few knobs; the two-way nudge is far more accurate, until the nudge is so tiny that rounding takes over.
The loss is a sum over examples, so its slope is too. A random handful gives ; scaled by , it is right on average, and its noise shrinks like . Step on it: . That is minibatch gradient descent; is stochastic, and is batch.
In one sentence: batch, minibatch and stochastic differ only in how much data they read per step; a random spoonful is right on average, so per data read the noisy walkers win — which is why deep learning uses minibatches.
With a noisy slope and a fixed stride, the walker ends in a cloud around the bottom whose size grows with the stride: its variance is about , where is the size of the noise. A shrinking stride with and closes the cloud. The same shake can lift a walker out of a shallow dip.
In one sentence: a noisy slope is a shaking hand — a fixed stride leaves a jitter cloud, a shrinking stride closes it, and the same shake can hop a walker out of a shallow dip.
In one sentence: gradient descent is one reflex — step against the slope — and this whole unit is about how big, how exact and how cheap that step should be.
The bill is the total area of the patches: . Its slope is every row's push, added up: .
A row that guessed too high pushes the knobs down along itself. A row that guessed too low pushes them up. A bigger miss pushes harder.
In one sentence: the bill is the total area of one square patch per data row, and its slope is each row's miss times that row, added up — the same recipe for one knob or a billion.
Start small, centred and random: small so the first step stays on the map, random so no two knobs are clones.
And when the numbers explode anyway, look at the factor . It is the size of the data, not your start, that needs fixing.
In one sentence: start small and random — and when the numbers explode anyway, blame the feature's size squared in the factor , not the place you started.
More knobs than facts means a zero training bill is free, so a zero training bill means nothing. Judge a model on rows it has never seen.
Later units add a small charge for big knobs (a regulariser). Then "fits the data with small knobs" beats "fits the data with any knobs", and the learner wins.
In one sentence: with more knobs than facts a zero bill is free and so means nothing — the memoriser hits every training row and still cannot see the one feature that matters.
A knob's sensitivity is its feature's size, squared: . One stride moves knob by .
So features of different sizes make one knob overshoot while another crawls. No stride can serve both. Rescaling the features is the fix.
In one sentence: a knob's sensitivity is its feature's size squared, so features of different sizes turn one stride into a fire hose on one knob and a drip on the other — and only rescaling the features can fix it.
Rescaling changes the units, not the meaning. After standardising, every column has average and , so every column is the same size and one stride can serve every knob.
What rescaling does not fix: two columns that rise and fall together. That leftover comes back in Section 10.
In one sentence: centring slides, standardising squeezes, min–max boxes — all three put every column on the same scale, and all three treat new data with the training numbers.
Descent finds the valley downhill from where it starts, and the watershed decides which one. Restarts give chances: all fail with probability .
With knobs of dips each, the dips multiply to , and the chance of being right on every knob shrinks to .
In one sentence: the side of the watershed you start on decides the valley you reach, and with many knobs the valleys multiply like the settings of a combination lock — so restarts alone cannot save you.
Step length is stride × tilt: . Small tilt means small steps, whether or not you are near a valley. A flat of width and tilt costs about steps.
The cure comes next unit: momentum, which keeps rolling across the flat instead of deciding every footstep afresh.
In one sentence: each step is stride times tilt, so a plateau — small tilt, but no valley — can swallow hundreds of thousands of steps.
Each direction shrinks by its own factor, . The steepest direction sets the speed limit, . At that limit the gentlest direction crawls, and measures how badly.
Steepest descent is the best direction for this one step, never the best direction for the whole trip.
In one sentence: in a canyon each direction shrinks by its own factor , the steepest wall sets the speed limit, and , steepest over gentlest, tells you how much of the walk is wasted bouncing.
Along a contour the height does not change, so : the gradient is at right angles to every contour.
It points at the bottom only when the contours are circles. On ovals, the angle between "steepest" and "towards the bottom" is the zig-zag.
In one sentence: a step along a contour changes nothing, so the gradient crosses every contour at a right angle — which points at the bottom only when the contours are circles.
The bill's steepness in knob is : the column's size, squared. The full table of steepnesses is . Standardising makes every diagonal entry , so the walls level out: here falls from to .
The part that survives is the off-diagonal, from columns moving together. Removing it takes a rotation, not a rescaling.
In one sentence: the bill feels each column squared, so dividing every column by its own spread levels every wall — the canyon becomes a bowl, the safe stride grows a hundredfold, and the model and the data's meaning stay untouched.
Every failure has a signature on the loss curve: blow-up, the train–test scissors, a growing zig-zag, fast-then-crawl, flat from the start, a different answer every run.
Every fix either reshapes the landscape or teaches the walker.
In one sentence: every failure in this unit leaves its own shape on the loss curve, and every fix either reshapes the landscape or gives the walker better instincts.
In one sentence: most training troubles are a badly shaped landscape, and the cheapest way to reshape it is to put every feature on the same scale.
Each step multiplies every direction by its own number, and all those numbers share one . Pick for the steep direction and the gentle one crawls. Pick it for the gentle one and the steep one blows up. No single stride serves both.
In one sentence: The slope tells you which way is down but not how long it lasts, so one shared stride must suit every direction at once — and when directions differ tenfold, no stride can.
Each move is a faded copy of the last move plus a fresh push. Pushes that agree pile up to times one push — ten times at . Pushes that flip cancel. You pay for the speed with overshoot.
In one sentence: Momentum adds a faded copy of the last move, so pushes that agree pile up to times a plain step and pushes that flip cancel — at the cost of overshoot, where the loss may rise for a while.
( means "multiply entry by entry".) Each knob divides its step by the root of its own total. On step one this leaves exactly for every knob, whatever its slope. But the total never shrinks, so the steps only ever get smaller.
In one sentence: Divide each knob's step by the root of everything it has ever felt, and the first step is exactly for every knob — but the record never clears, so the brake never lifts.
Swap the running total for a fading average, and the stride settles at a healthy size instead of dying. On a steady slope it settles at exactly . The price is a first step that is times too big.
In one sentence: Swap the permanent record for a fading one and the stride survives all the way down — at the price of a first step that is times too big, because an average that starts at zero is a wild guess after one reading.
Step = average direction ÷ root of average loudness, times a warm-up rate . Pushes that disagree cancel, loudness divides out, and the very first step is exactly .
In one sentence: Adam keeps a signed average and a squared average for every knob, steps by their ratio so disagreement cancels and loudness divides out, and uses a warm-up rate that makes the first step exactly and then switches itself off.
The steepest direction sets the safe stride. The gentlest direction sets how many steps you need. Their ratio (read "kappa", the condition number) is the tax plain descent pays. The adaptive methods divide each slope by its own size, so they never see at all.
In one sentence: Plain descent's safe stride is set by the steepest direction and its speed by the gentlest, so it pays the condition number in steps — while every adaptive method divides each slope by its own size and never notices.
Three roles, three pictures. is the score: you want it small. is the path: you must stay exactly on it. Each is a fence: you must stay behind it. So becomes , whose slope is . Watch that minus sign — it is where most marks are lost.
In one sentence: Put a wall in a problem and the answer moves onto the wall, where the slope is not zero — so "stop where it is flat" must be replaced, starting by writing every problem as with and .
At the answer, nothing is left to slide along the fence. So the score's arrow and the fence's arrow lie on one line. They are parallel, not equal, and is the stretch between them. Soon will turn out to be a price.
In one sentence: You stop when nothing is left to slide along the fence, so and lie on one line with a stretch between them — and that stretch is about to become a price.
Obey the fence and the guard's best fine is : you pay nothing. Break it and the guard raises without limit. So the Lagrangian — score, plus a fine for leaving the path, plus a fine for each fence — is not a rough copy of the problem. It is the problem, with rules turned into prices.
In one sentence: You cannot differentiate an infinite wall but you can differentiate a straight line, and letting the guard raise the line's slope rebuilds the wall exactly — so with is the fenced problem itself.
Write the room left as a square and differentiate. Out comes : either you have room and the fine is zero, or you are touching and the fine may be positive. Never room and a fine at once.
In one sentence: Write the room left as a square, differentiate, and out comes — either there is room and the fine is zero, or you are touching and the fine may be positive.
KKT is "set every derivative to zero" on the Lagrangian, plus the sign rule. To use it by hand, guess for each fence whether it is touching, solve, and throw out any guess that gives a negative fine or breaks a rule.
In one sentence: KKT is "set every derivative to zero" on the Lagrangian plus the sign rule, and room-or-fine turns it into cases to check, most of which die on a negative fine.
The curve stays under every string, or, the same thing, above every tangent. The tangent form means one slope reading is a promise about the whole function. On a convex problem, a point that passes the five conditions is the answer.
In one sentence: A bowl never rises above its strings and never dips below its tangents — and on a bowl with bowl fences, a point that passes the five conditions is the answer; anywhere else it is only a candidate.
Left, you move first: the primal. Right, the guard moves first: the dual. Moving second is an advantage, so the dual is always a lower bound. And the dual is the lowest of many straight lines, so it is always a hill.
In one sentence: Letting the guard move first gives the dual, which is the lowest of many straight lines — so it is always a hill and always a lower bound — and the fine it hands back is the price of the wall.
The boundary is built from the fines: in general , with . Points far from the boundary get and could be deleted. Only the touching points — the support vectors — matter.
In one sentence: The widest road is the smallest that clears every point, its dual has one fine per training point, and room-or-fine makes almost all of them zero — so the machine rests on a few support vectors.
In one sentence: Optimisers divide each step by what that knob has felt, and fenced problems turn every wall into a price — and the price tells you which walls matter.