LATENT SPACE LAB · TRAINING · EPOCH ∞

Machine Learning & Artificial Intelligence
From First Principles to Agentic AI

Mathematical derivations × from-scratch implementations × curated video lectures × interactive experiments · continuously updated

This course walks you down one complete path: starting from the first-principles question of "what is machine learning," through classical algorithms, deep learning, and the Transformer architecture, all the way to the most cutting-edge large language model training techniques and Agentic AI system design. Every chapter includes detailed mathematical derivations, from-scratch code implementations, curated videos with viewing guides, and hands-on interactive experiments and chapter quizzes.

AUDIO // Course Audio Introduction · 0:25

How to Use This Course

Course Outline

00
Prologue · Seventy Years of AI: An Interactive History Timeline
An infinitely pannable, zoomable history canvas: 7 main storyline lanes · 55+ milestones (click for technical deep dives) · two AI winters · from the 1943 McCulloch-Pitts neuron to 2026 Agentic AI · the AlphaGo documentary
ready
01
Introduction to Machine Learning & Core Concepts
The essence of machine learning · supervised/unsupervised/reinforcement learning · loss functions and generalization · the full derivation of linear regression (normal equations + gradient descent) · the bias-variance decomposition · from-scratch implementation in NumPy · an interactive gradient descent lab
ready
02
Classical Machine Learning Algorithms
The full derivation of logistic regression and cross-entropy · softmax and the temperature parameter · decision trees (information gain / Gini) · random forests and gradient boosting / XGBoost · the SVM dual and the kernel trick · a decision-boundary showdown lab (three algorithms visualized in real time)
ready
03
Foundations of Deep Learning
Paying off the XOR setup · the universal approximation theorem and how it's misread · the full four-step derivation of backpropagation (the δ recurrence) · the evolution of activation functions (sigmoid → ReLU → SwiGLU) · SGD → Momentum → Adam → AdamW derived term by term · He/Xavier initialization · Dropout/BatchNorm/LayerNorm/RMSNorm · a lab that trains a real neural network in the browser · hand-written backprop in NumPy vs. PyTorch
ready
04
CNNs & Computer Vision
Inductive biases: local connectivity + weight sharing · output size / channels / receptive field · the five epiphanies from LeNet to ResNet · residual connections = a gradient highway (∂y/∂x = ∂F/∂x + I) · ViT and the bitter lesson · a convolution-kernel lab (edit a 3×3 kernel by hand and watch the feature map)
ready
05
Sequence Models: RNNs/LSTMs and the Birth of Attention
Weight sharing across the time dimension · BPTT and the exponential fate of repeatedly multiplying W_h · gradient clipping · the derivation of the LSTM's three gates (the cell state = a residual across time) · the fixed-vector bottleneck of Seq2Seq · the three-step Bahdanau attention (the prototype of Q/K/V) · teacher forcing and exposure bias · an attention-alignment heatmap lab
ready
06
The Transformer Architecture in Depth ★ Core Chapter
The three-step transformation from Bahdanau attention to self-attention · the √d_k variance derivation · causal masking and training parallelism · the division of labor across multi-head subspaces · positional encoding (sinusoidal → RoPE rotation) · assembling a GPT block from FFN/Pre-LN/residuals · the 12Ld² parameter shortcut verified against GPT-2 · a step-by-step self-attention calculator · Karpathy's nanoGPT, a must-do follow-along
ready
07
Large Language Models I: Pretraining
Next-token prediction = compression · BPE and the blame the tokenizer takes · Kaplan → Chinchilla → overtraining (inference-optimal) · the FineWeb data pipeline · 3D parallelism and ZeRO · Dense vs. MoE, the detailed accounting · linear/hybrid attention and framework maturity (a 15× throughput case study) · practical training hyperparameters · a scaling-law calculator lab
ready
08
Large Language Models II: Alignment & Fine-Tuning
Base model = document simulator · SFT engineering (chat template / loss mask / LIMA) · a methodology for the small-model + SFT vertical loop (evaluation first / a 0 → 9 baseline) · the math of LoRA and QLoRA · RLHF and reward hacking · the full three-step derivation of DPO · GRPO/RLVR, the engine behind reasoning models · a LoRA memory calculator · hands-on MLX commands
ready
09
LLM Inference & Deployment
Prefill/decode and roofline mental math · the KV cache formula and the memory budget · MQA → GQA → MLA · PagedAttention/vLLM · the quantization family tree · why speculative decoding is lossless · the full sampling toolkit · cost engineering (cache hit rates / usage funnels / model tiering) · two labs: a KV calculator + a product cost estimator
ready
10
RAG & Vector Retrieval
The three cardinal sins of parametric knowledge · contrastive learning and the bi-encoder / cross-encoder trade-off · HNSW, "fly first, then bike" · parent-child chunking strategies · hybrid retrieval + RRF + reranking as a two-stage funnel · a failure-mode checklist (lost in the middle…) · long context vs. RAG · Agentic RAG · a semantic vs. keyword retrieval lab · a 60-line minimal RAG
ready
11
Agentic AI System Design ★ Key Chapter
Agent = the demystified definition as a while loop · breaking down the tool-calling mechanism · the spectrum of workflows and the "three questions" · five techniques of context engineering · memory and the accretion of Skills · a deep dive into Memory as a standalone system design (precise writes / precise reads) · the MCP protocol · multi-agent orchestration · the design discipline of small-model tasks · an anatomy of a real coding-agent architecture · pass^k and guardrails · six frontier research directions for 2026 · a three-trajectory simulator · an 80-line bare-bones agent
ready
12
Multimodality & the Frontier
The math of diffusion models (closed-form forward process / ε-prediction = regression / CFG) · latent space = paying off the course's name · DiT · multimodal LLMs (everything ends up as tokens) · the world-model debate · four filters for evaluation · SAE interpretability · three unfinished curves · a 50-step denoising lab (a 16×16-pixel cat)
ready
13
Putting It All Together · Post-Training a Small Model for a Vertical Use Case ★ Capstone Project
Eight end-to-end steps: schema design (verifiability is something you design in) · eval.py and a 0/12 baseline · a reverse-engineered data pipeline · an architecture comparison experiment (the 15× throughput trap) · two-stage MLX training (600-step validation → an overnight full run) · failure attribution and data iteration · quantized deployment and cost accounting · agentic integration and the road to RLVR · a verifier lab
ready
A
Appendix · Information Sources Worth Following
Curated blogs (Karpathy, Lilian Weng, Jianlin Su…) · courses and books (CS231n, d2l.ai…) · video channels · papers and leaderboards · newsletters and podcasts · official lab blogs · plus suggested strategies for keeping up
ready
The main course is complete (the Prologue + 13 chapters + the Appendix are all live): 26 curated videos all backed up offline, 14 interactive labs, 13 audio introductions, and 120+ quiz questions with explanations. The recommended study order is simply the chapter order; the appendix's list of sources will help you stay on the frontier after the course. New material will still be added from time to time (new nodes on the timeline, new sources in the appendix).

Prerequisites