Train real models, in real time
Two browser-native trainers — a polynomial-regression fitter and a tiny neural-network classifier — with sliders for learning rate, epochs, hidden units, dataset size and more. Every step runs real gradient descent in JavaScript and updates the model, prediction surface, and loss curve live.
Polynomial regression
Fit a polynomial of chosen degree to a noisy 1-D dataset (think: concrete strength vs w/c ratio). Watch underfit / overfit emerge as you sweep degree and learning rate.
Tiny neural-network classifier
A real multi-layer perceptron trained with mini-batch SGD and binary cross-entropy. Sweep the hyperparameters and watch the decision boundary and loss curve respond.
What's running under the hood?
- An MLP with a configurable stack of hidden Dense layers + chosen activation, and a final sigmoid output.
- Real backpropagation through every layer, mini-batch SGD with the chosen batch size and learning rate, BCE loss.
- Weights are Xavier-initialised; the training loop yields to the browser every few epochs so the canvas stays responsive.
- The decision-boundary canvas evaluates the trained network on a 96×96 grid after each chunk — that's why busy regions get smoother as training progresses.
- Try LR too high (≥ 1) to see the loss curve oscillate / diverge, or too low (≈ 0.001) to see painfully slow convergence — the classic hyperparameter lessons.