Interactive labs
Each lab also appears inside its lesson. Open one here when you want to experiment without the surrounding text. All data is synthetic and generated with fixed seeds. Press Watch on any lab for a guided, captioned tour, or read a visual explainer, where the lab follows along as you scroll.
Foundations
Choosing a paradigm and seeing over- and underfitting.
Which learning paradigm?Answer three questions about a problem and see which paradigm fits, with seven worked scenarios.Lesson: Learning paradigmsUnderfitting vs overfittingChange polynomial degree, training size, and noise; watch training and validation error split apart.Lesson: Overfitting and the bias-variance trade-offQ-learning on a grid worldStep an agent through a small grid world, watch the Q-table and greedy policy update, and tune learning rate, discount, and exploration.Lesson: Q-learning and SARSA
Classical ML
Regression, thresholds, neighbors, trees, boosting, clustering, and PCA.
Linear regressionDrag points, tilt the line, see residuals, MSE and MAE live, and toggle L1/L2 penalties.Lesson: Linear regressionClassification thresholdMove the threshold and watch the confusion matrix, precision, recall, F1, and business cost change.Lesson: Classification metrics and thresholdsK-nearest neighborsMove a query point, change K and the distance metric, and see what feature scaling does.Lesson: K-nearest neighborsBuild a decision treePick features and thresholds, see Gini before and after each split, and grow the tree region by region.Lesson: Decision treesGradient boosting, round by roundWatch each stump fit the residuals; tune learning rate and rounds and find where test error turns up.Lesson: Random forests and gradient boostingK-means clusteringPlace centroids, step through assignment and update, and change K and the initialization.Lesson: K-means clusteringFind the first principal componentRotate a projection axis over a 2D cloud and see variance kept versus thrown away.Lesson: PCA, t-SNE, and UMAP
NLP Lab
Turning text into vectors you can compare.
Neural Network Lab
Forward passes, gradient descent, backpropagation, and convolution.
Neural network forward passChange weights and activations in a 2-3-1 network and follow every number and tensor shape.Lesson: The neural-network forward passGradient descentStep across a loss surface with SGD, momentum, or Adam, and push the learning rate until it diverges.Lesson: Gradient descentBackpropagation, step by stepA one-neuron classifier: edit the inputs and weights and recompute all nine steps.Lesson: BackpropagationConvolution and poolingStep a 3×3 kernel over an image, see each multiply-and-add, then max-pool the feature map.Lesson: Convolutional networks
Transformer Lab
Self-attention computed one operation at a time.
Self-attentionStep through Q, K, V, QKᵀ, scaling, the causal mask, softmax, and the weighted sum, with shapes.Lesson: Self-attentionMixture-of-experts routingRoute tokens to experts with a learned gate; change top-k and capacity and watch load balance, dropped tokens, and active parameters.Lesson: Mixture of expertsAttention masks and variantsCompare full, causal, sliding-window, and sparse attention masks; see which tokens each query can reach and how cost grows with length.Lesson: Attention variantsContrastive image-text matchingBuild the image-text similarity matrix, apply temperature and softmax, and see how the contrastive loss pulls matching pairs together.Lesson: CLIP and contrastive image-text pretraining
LLM and RAG Lab
Tokens, decoding, and retrieval-augmented generation.
Temperature, top-k, top-pTurn logits into a next-token distribution and watch each sampling knob reshape it.Lesson: DecodingTokenization explorerType text, step through BPE merges, and watch tokens fill a context window.Lesson: Tokenization and pretrainingRAG pipelineChunk documents, retrieve and rerank for a question, and see what happens when retrieval misses.Lesson: The RAG pipelineLoRA and fine-tuning memoryPick a model size, rank, and precision; compare trainable parameters and GPU memory for full fine-tuning, LoRA, and QLoRA.Lesson: Fine-tuning in practiceApproximate nearest neighborsPartition vectors into clusters, probe a few, and trade recall against the number of distance computations.Lesson: Vector searchKV cache and inference memorySize the weights and KV cache for a model, context, and batch; see whether it fits and how fast decoding can go.Lesson: LLM inferenceStatic vs continuous batchingSimulate requests of different lengths on a GPU and compare throughput and latency under each batching policy.Lesson: Serving LLMsData parallelism and ZeRO memorySplit weights, gradients, and optimizer state across GPUs with DDP, ZeRO-1/2/3, and FSDP; compare memory per GPU and communication.Lesson: ZeRO and FSDP
AI Engineering
Production architecture and security for systems built around models.
Production LLM architectureClick components for failures, metrics, and security; trace requests through normal, cache, outage, and tool scenarios.Lesson: Production architecturePrompt injectionRun mocked attacks hidden in retrieved documents and switch on defenses to see which layer stops each one.Lesson: Securing AI systemsAgent loopStep through an agent's think, call tool, observe loop with mocked tools; inject failures and step limits.Lesson: Tool use and agentsRecommendation funnelSize candidate generation, ranking, and re-ranking stages against a latency budget and watch recall and cost move.Lesson: ML system designA/B test power and peekingCompute sample size from baseline, effect, and power, then simulate how peeking inflates false positives.Lesson: Experimentation and A/B testing