Why formulas at all?
The neuron chapter said: “First input times first weight, plus second input times second weight, plus bias.” Clear enough, but with ten inputs it turns into a tapeworm. Formulas are shorthand, like “BRB” instead of “be right back”. They explain nothing new; they just save space.
This chapter is a cheat sheet. You don't have to memorize anything. Just come back whenever a symbol in a math corner looks strange.
A letter is a name for a number
“x is 2” means: the number 2 currently goes by the name x. In another example x can be a different number, like a blank in a form.
The multiplication sign likes to hide in formulas: 3 × x, and all mean the same thing. With x = 2 you get 6. The = means “has the same value as”, and ≈ means “approximately”, for example after rounding.
A function is a calculation rule with a name
means: the rule called f takes a number and triples it. means: “apply the rule to 2.” Result: 6.
So the parentheses are not a multiplication sign here! If you program, you know this: triple(2) returns 6. Mathematicians are just lazy writers and call the function f.
With nesting like , you work from the inside out: first apply f to 2, then g to the result. This is exactly how the layers of a network will fit together later.
Small numbers up and down
| Notation | Meaning | Example |
|---|---|---|
| The second element of a collection | In [4,7,9] the second element is 7 | |
| Multiply x by itself | For x=3, x²=9 | |
| The element one place after position t | After position 3 comes position 4 | |
| All elements before position t | Before position 3 are positions 1 and 2 |
The small number at the bottom is called an index, a kind of house number. A common trap: in math you usually count from 1, Python counts from 0. With code we always say which one we mean.
A hat on a letter, as in , is read “y-hat”. In this book it almost always means: prediction. without a hat is then the target. The hat is a name tag, not a calculation.
A sum is repeated addition
The list [2,4,6] has the sum 2+4+6=12. In shorthand:
Read the formula: add up the list elements while the number i runs from 1 to 3. The big Σ is called sigma, a Greek S, as in sum. Below it is where it starts, above it is where it stops.
The i is a running variable, a counter that takes the values 1, 2 and 3 in turn. Whether it is called i or j doesn't matter. The main thing is that it has the same name everywhere.
A product is repeated multiplication
The same list multiplied: 2×4×6=48. For this there is the big Π, a Greek P as in product:
Sum and product look alike but are different instructions. Later we will meet products of probabilities. Then we will first write out a few factors before the shorthand comes.
Fractions, mean and square root
A fraction bar means “divided by”. The sum divided by the count gives the average, technically the mean. For 2, 4 and 6: (2+4+6)/3=4.
The square root √ asks: which number times itself gives this? √9 is 3, because 3×3=9. √2 is about 1.414. In this book, roots are mainly used to bring numbers to a manageable size.
The absolute value is the distance from zero; the sign gets thrown out: 4 and −4 both have absolute value 4. Handy when you only care about “how big” and not “which direction”.
Greek letters: just names too
η (“eta”) will stand for the learning rate later, ε (“epsilon”) usually for a tiny helper number. Sounds important, but it is just naming. The letters themselves can't do anything.
Careful: the same symbol can mean different things in different texts. That is why a good formula always comes with an explanation. In this book it sits right next to it.
What is not here
Derivatives, the exponential function and the logarithm are not on this sheet. The book explains them exactly where they are needed, with numbers first.
The most important trick to finish: when a formula looks intimidating, simply plug the numbers from the example in for the letters. Most of the time it immediately becomes harmless.