Algorithms

Each lab runs real training in your browser. More are on the way.

01

Classic machine learning

Linear and logistic regression, decision trees, K-means. Start with a straight line and watch it follow the gradient, step by step, onto the data.

  • Classical ML

    Linear regression

    Least-squares lines and planes: QR closed form and gradient descent; drag any point and it recomputes.

    2D + 3D
  • Classical ML

    Logistic regression

    A probabilistic binary classifier: sigmoid, cross-entropy, gradient descent and Newton's method, threshold, confusion matrix and ROC.

    2D + 3D
  • Classical ML

    Decision tree

    CART grown one split at a time: Gini, entropy and MSE, the split search, tree diagram and cost-complexity pruning.

    2D + 3D
  • Classical ML

    K-means clustering

    Lloyd's algorithm step by step: k-means++ seeding, Voronoi cells, elbow and silhouette, 100,000 points on the GPU.

    2D + 3D
  • Classical ML

    Support vector machine

    Soft-margin SVM solved by SMO one α-pair at a time: margins, support vectors, kernels and the explicit feature map.

    2D + 3D
  • Classical ML

    Principal component analysis

    Principal components by power iteration: axes, projection, explained variance and reconstruction, in 3D and on the iris data.

    2D + 3D
  • Classical ML

    k nearest neighbours

    k nearest neighbours: decision regions as k changes, distance balls, accuracy against k, a 20,000-point grid on the GPU.

    2D + 3D
  • Classical ML

    Gaussian discriminant analysis and naive Bayes

    Gaussian naive Bayes, LDA and QDA learned one sample at a time: ellipses, posteriors, boundaries and probability hills.

    2D + 3D
  • Classical ML

    Random forest

    A random forest grown one tree at a time: bootstrap samples, random features, out-of-bag error and the averaged vote.

    2D + 3D
  • Classical ML

    Gradient boosting

    Gradient boosting stage by stage: each small tree fits the residuals and the fit sharpens, in 1D and as a 3D surface.

    2D + 3D
02

Neural networks

From the perceptron to multilayer networks: each line is as thick as its weight right now, each neuron is colored by its output, all changing as it trains.

  • Deep learning

    Perceptron

    Rosenblatt's perceptron one sample at a time: the update rule, Novikoff's convergence bound, weight space, and why XOR defeats it.

    2D + 3D
  • Deep learning

    Neural network (MLP)

    Train a real multilayer neural network in your browser and see what every neuron learns.

    2D + 3D
  • Deep learning

    Convolutional neural network

    A real convolutional network trained in your browser on generated digits: feature maps, receptive fields, kernels, and a pad to draw on.

    2D + 3D
03

Transformer

Where does attention actually look? Every cell of the matrix is a softmax over how much one token attends to another.

  • Transformer

    Self-attention and multi-head attention

    Scaled dot-product and multi-head attention, trained live: every Q, K, V, score, mask and softmax, and the patterns heads learn.

    2D + 3D
  • Transformer

    Transformer

    A small GPT trained in your browser on copy, reverse, sort and addition: residual stream, every block, attention maps and sampling.

    2D + 3D
04

Reinforcement learning

An agent searches a grid world for the exit. Value flows back from the goal, and the arrows are the route it learned.

  • Reinforcement learning

    Q-learning and SARSA

    Q-learning, SARSA and Expected SARSA on Gymnasium's cliff walking and frozen lake, step by step, against the exact optimum.

    2D + 3D
  • Reinforcement learning

    Deep Q-network (DQN)

    A deep Q-network trained live on CartPole and MountainCar: experience replay, a target network, Double DQN and the Q surface.

    2D + 3D
  • Reinforcement learning

    Proximal policy optimization (PPO)

    PPO trained live on CartPole: rollouts, GAE, the clipped objective with every ratio, actor and critic.

    2D + 3D