A 2-layer MLP trains from scratch in your browser using pure JavaScript — no library. Watch weights update, loss drop, and the decision boundary form.
The network makes a prediction → we compute loss → we compute the gradient of loss with respect to each weight using the chain rule → we update weights in the direction that reduces loss.