#021هذا الفيديو ونصه باللغة الإنجليزية.
How AI learns: guess, measure the error, nudge, repeat
AI learns by guessing, measuring how wrong it was and nudging its internal knobs, over and over. Here is that loop in plain words, with a guitar example.
بالتفصيل
How an AI learns
Training an AI model comes down to a loop with three moves. It makes a guess. It measures how wrong that guess was, as a single number. Then it turns its internal settings, called weights, a tiny bit in the direction that makes that number smaller. Repeat, and the guesses improve. Large models have millions of these settings, and the biggest have billions; the same loop tunes them all at once.
What the video shows
The short follows its four captions: guess, measure, nudge, repeat. A small network is shown a cat and guesses "Dog", which is marked wrong, and a meter shows how wrong. That error travels backwards through the network's connections, which is how each knob finds out which way to turn, and the knobs get nudged. Then it fast-forwards: example after example, a counter climbing to a million, the error shrinking. At the end a new cat comes in, and the answer is "Cat".
An everyday example
Imagine tuning a guitar with a tuner app. You pluck a string, and the app tells you two things: how far off the note is, and whether it is too high or too low. Way off? You give the peg a big turn. Nearly there? A tiny one. Your turns shrink as you get closer, and after a few rounds the note is right. Training works the same way, except there are millions of pegs, all turned a little at once, and "how far off" is a single number for the whole model.
How it works
The simplest learners only hear "right" or "wrong". This loop hears "how wrong", which is what lets it take big steps when it is far off and small ones when it is close. Three pieces make it run:
- A score for being wrong. Called the loss, it turns "how bad was that guess?" into one number. Lower is better.
- A direction for each knob. For every weight, the model works out whether turning it up or down would lower the score, and how strongly. That is the slope, also called the gradient.
- A small step. Each weight moves a little in the downhill direction. The move is the slope multiplied by a small number you choose, called the learning rate, so steps are big where the slope is steep and small where it is gentle.
Together this is gradient descent: walking downhill on the error, one small step at a time. Our free course writes the whole thing in about twenty lines of code, without any machine-learning library.
Its test case fits a straight line through eight points. With both of its settings starting at zero, the error is about 57.4. After one step it is about 26.7, after two about 24.7, and by step ten it has settled at about 24.59. The loop matched the answer a textbook formula gives to eight significant figures (the first eight digits agree), without knowing that formula exists. That matters, because for real neural networks there is no such formula, and a loop like this is how they get trained.
A common misconception
"Until it gets it right" does not mean the error reaches zero. In the course's example it settles at about 24.59, because no straight line passes through all eight points. The loop finds the least wrong answer available, not a perfect one.
Notice also where the progress happens: most of it comes in the first two steps. The slope is steepest far from the bottom and flattens near it, so the steps shrink on their own. That is convenient, and the course later shows it can also become a problem.
Why it matters
The course presents this loop as the algorithm that trains every model that follows, including ones with hundreds of billions of weights. So when someone says a model "learned" something, it means exactly this: a huge number of tiny corrections, each one making the error score a little smaller.
Learn it step by step in Chapter 3 of our free course AI From Scratch: Downhill: Gradient Descent, and the Two Steps Everyone Skips.
على الشاشة
First, it makes a guess. Then measures how wrong it was. Nudges millions of tiny knobs. Repeat… until it gets it right.
متاح أيضًا على
المزيد من هذا الفصل
#021
#022Derivative: how much the result moves when you nudge one input
#023Chain rule: how AI traces the effect of every layer
#024Gradient: the arrow that points uphill, and why AI walks the other way
#025Gradient descent: how AI finds its way downhill in small steps
#026Learning rate: the step size with a ceiling you can calculate
كُتب النص بمساعدة الذكاء الاصطناعي استنادًا إلى الفصل 3 من دورتنا المجانية.