Chapter C23 · Interactive Course

One training step at a time

Predict, measure, adjust — and which numbers are which.

Start chapter in web app

Core Learning Concept

Trace one full learning step: predict outputs, evaluate loss, compute gradients, and update weights. Distinguish measurement from parameter modification, keeping batch aggregations, chosen learning rates, and saved checkpoint weights clearly separated.

What You’ll Learn in This Chapter

  1. Start with an imperfect prediction

    Activity 1 of 10 · 4 min

    Identify the forward pass in training.

    A forward pass computes predictions from inputs using current model parameters. During training, this output is compared against target labels. "Forward" simply describes the direction of computation through successive layers.

    Start activity →

  2. Measure the mismatch

    Activity 2 of 10 · 5 min

    Explain loss as a chosen measure of prediction error.

    Loss is a chosen numerical metric measuring disagreement between predictions and targets. Different loss formulas penalize errors differently. Lower loss indicates closer agreement on measured targets, rather than general correctness across all tasks.

    Start activity →

  3. Find a direction to improve

    Activity 3 of 10 · 5 min

    Interpret a gradient as a local direction signal.

    A gradient describes how a small parameter change would locally affect the loss. In one dimension it resembles a slope; with many parameters it contains a component for each one. Gradient-based training uses this local information to choose updates. It does not provide a map proving where the global best solution lies.

    Start activity →

  4. Send the error signal backward

    Activity 4 of 10 · 5 min

    Explain backpropagation's role in assigning parameter-change information.

    Backpropagation determines how each weight influenced the overall loss by moving backward through layers using the chain rule. Calculating these gradient values measures sensitivity, but does not alter parameters until the optimizer runs.

    Start activity →

  5. Take a learning step

    Activity 5 of 10 · 4 min

    Identify the parameter update performed by an optimizer.

    An optimizer applies a parameter-update rule. In basic gradient descent, the new weight equals the old weight minus the learning rate times its gradient. If the weight is 1, the gradient is 2, and the rate is 0.1, the updated weight is 0.8. Other optimizers modify this procedure.

    Start activity →

  6. Choose the step size

    Activity 6 of 10 · 5 min

    Explain the learning rate as a training setting.

    The learning rate multiplier scales parameter updates during training. Excessive step sizes cause erratic overshooting, whereas tiny steps make convergence sluggish. This chosen hyperparameter balances overall training speed against numerical stability.

    Start activity →

  7. A batch is a group of examples

    Activity 7 of 10 · 4 min

    Recognize which examples contribute to one update.

    A batch is a group of examples used together to calculate an update or an intermediate gradient estimate. With batch size four, the system processes four examples before that update. Batch size affects memory, computation, and learning behavior; it is different from the total number of examples in the dataset.

    Start activity →

  8. An epoch is one pass through the examples

    Activity 8 of 10 · 4 min

    Identify an epoch in a finite training dataset.

    An epoch is one pass through the training dataset under the stated sampling setup. If there are one hundred examples and batches contain ten, one simple epoch contains ten batches. More epochs repeat exposure to the data; they do not automatically add new independent examples or guarantee better generalization.

    Start activity →

  9. A checkpoint saves a model state

    Activity 9 of 10 · 4 min

    Recognize a saved training snapshot.

    A checkpoint saves current training parameters and optimizer state to disk. Checkpoints allow recovering interrupted runs and selecting the best performing intermediate model rather than blindly keeping the final epoch.

    Start activity →

  10. Animate a training step

    Activity 10 of 10 · 6 min

    Order prediction, loss, backward gradient calculation and update; identify the learning-rate control and the saved settings.

    Start activity →