The Training Loop in Plain English
Predict, measure error, adjust — repeat.
The Training Loop in Plain English is a free Deep Learning Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Deep Learning Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Learning Is a Loop
Every deep model learns the same way: a simple loop repeated thousands of times. Master this rhythm and the rest clicks into place. 🔁
Step One Predict
First the model makes a prediction. It takes your input, pushes it through its weights, and guesses an answer, even if that guess is rough at first.
Guesses Start Bad
At the very start the weights are random, so early predictions are basically noise. That is expected, and improving them is the whole point.
Step Two Measure Error
Next you compare the guess to the true answer and compute the loss, a single number showing how wrong the model was this time.
Loss Is the Compass
A high loss means a bad prediction, a low loss means a good one. The model's only goal is to push this number down, step by step.
Step Three Find the Fix
Then the model asks which way to nudge each weight to lower the loss. Those directions are the gradients, computed automatically for you.
Step Four Adjust
Finally the optimizer nudges every weight a tiny bit in the helpful direction. This small update makes the next prediction a little better.
Then Repeat
Predict, measure, adjust, then do it again on the next batch. Across many iterations the loss falls and the model slowly grows accurate.
One Epoch
When the loop has seen every training example once, you have finished one epoch. Most training runs through many epochs in a row.
The Loop in Code
In PyTorch the four steps map to four lines you will write again and again. Here is the core loop in plain code.
pred = model(x)
loss = loss_fn(pred, y)
loss.backward()
optimizer.step()Why It Feels Like Magic
No magic, just repetition. Tiny, guided adjustments over and over turn random weights into a model that genuinely understands your data.
Quick Check
What are the steps of one training loop iteration, in order?
Recap
You learned the core rhythm: predict, measure the loss, then adjust the weights, repeated over many epochs until the model gets good. 🎉
Frequently asked questions
Is the “The Training Loop in Plain English” lesson free?
Yes — the full text of “The Training Loop in Plain English” is free to read here on the web, and the Deep Learning Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Deep Learning Academy course, upgrade to CoddyKit PRO.
What will I learn in “The Training Loop in Plain English”?
Predict, measure error, adjust — repeat. You practise Deep Learning Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Deep Learning Academy?
No prior experience is required. Deep Learning Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “The Training Loop in Plain English” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Deep Learning Academy lesson?
Yes. Every Deep Learning Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- AI vs Machine Learning vs Deep Learning
- Why Neural Nets Beat Hand-Crafted Features
- Where Deep Learning Wins (and Where It Doesn't)
- The Training Loop in Plain English