Full function
Click any dot. Green dots are the only data the model will see.
Alyana Leck learning portal
Select training samples from the full sine function, train a tiny model, and watch what it can or cannot generalize from the data it received.
Click any dot. Green dots are the only data the model will see.
Selected dots appear here. The learned curve is drawn only after training starts.
A model learns from the examples it is given, not from the examples we wish it had seen. If all selected dots come from one small region, the model can fit that region and still fail at peaks, valleys, and crossings.
The demo uses a small radial-basis-function model. It transforms x into a few smooth bump features, then trains a linear output layer with gradient descent. This is light enough to run instantly in the browser.
Only the selected dots are used in the loss function. The full sine curve on the left is visible to students, but it is not used during training.
Low training loss is not the same as broad understanding. A diverse training set gives the model evidence across the full problem, so its predictions have fewer unsupported gaps.
activation = tool(w * x + b)
prediction = weighted tools added together
error gives each weight a small nudge
Without nonlinear activation functions, stacked layers collapse into one linear transformation. Nonlinear tools let the model bend, gate, and localize parts of the curve.
First show one selected point and a bad prediction. Then reveal the activation tools. Next stretch and flip each tool with weights. Finally add the pieces and show residuals.
The residuals tell the model which pieces are pushing too high or too low. Gradient descent changes the weights a little bit, checks the loss, and repeats.
The layout uses a clear step-by-step teaching rhythm inspired by visual ML explainers, but the drawings are original and generated directly by this page.
Reference used for the teaching structure: StatQuest backpropagation main ideas and StatQuest ReLU in action.