AI & Machine Learning Formulas
Machine learning looks like magic from the outside. Inside it is a short list of formulas used over and over: a weighted sum, a squashing function, a way to measure how wrong a guess was, and a rule for getting a little less wrong each time. Read them in this order and the whole field gets a lot smaller.
8 formulas, in the order that makes them easiest to learn:
- Artificial Neuron (Weighted Sum)
-
An artificial neuron multiplies each input by a weight, adds them up with a bias, and then decides how strongly to fire.
- Sigmoid Function
-
The sigmoid takes any number, however big or small, and squeezes it into a value between 0 and 1 that can be read as a chance.
- Softmax
-
Softmax takes a list of scores, any numbers at all, and turns them into percentages that add up to 100%.
- Mean Squared Error (MSE)
-
Mean squared error measures how wrong a model’s guesses are by squaring each miss, so big misses count much more, and then averaging them.
- Cross-Entropy Loss
-
Cross-entropy loss gives a small score when the model was confident in the right answer and a big score when it was not.
- Gradient Descent
-
Gradient descent nudges a model’s settings a small step in the direction that lowers the error, then repeats until the error stops falling.
- Bayes' Theorem
-
Bayes’ theorem tells you how much to change your belief in something after you see new evidence.
- Scaled Dot-Product Attention
-
Attention lets a model look at every item in a list and decide how much each one matters for the item it is working on.