Machine learning
Model building blocks, data, classical ML, reinforcement learning and evaluation.
Foundations
The pieces every model is made of.
Loss functions
lowThe scalar a model minimizes: cross-entropy for classes and tokens, MSE or Huber for values, each with a stable form and simple gradient.
Weight initialization
lowPick initial weight variance so activations and gradients keep their scale through depth; He for ReLU, Glorot for tanh, scaled-down residual outputs for transformers.
Normalization layers
lowStandardize activations per batch, token or group with a learned scale so deep nets train fast and stably; RMSNorm in LLMs, BatchNorm in convnets.
Regularization
lowTechniques that trade training fit for generalization: weight decay, dropout, early stopping, label smoothing and data mixing, with the exact update rules and defaults.
Contrastive learning
mediumTrain an encoder so two views of the same thing score higher than every other pair in the batch; InfoNCE with a temperature, no labels needed.
Modern layers
What sits inside today's networks.
Attention variants
lowMulti-head, multi-query, grouped-query, sliding-window and latent attention; same softmax(QKᵀ/√d)V core, different trade-offs between quality and KV-cache size.
Rotary position embedding (RoPE)
lowEncode position by rotating pairs of query and key dimensions by position-dependent angles, so attention scores depend only on relative distance; the LLM default.
Mixture of experts (MoE)
lowReplace one FFN with many expert FFNs and a router sending each token to its top-k; parameters scale with E, per-token compute with k.
Embeddings
lowA learned table mapping discrete ids to dense vectors: gather forward, sparse scatter-add backward, row-wise optimizers to keep huge tables cheap.
recurrent networks
Planned.
matryoshka embeddings
Planned.
graph neural networks
Planned.
se3 equivariant networks
Planned.
knowledge graph embeddings
Planned.
Data
Turning raw data into training batches.
Byte-pair encoding (BPE) tokenization
lowLearn a subword vocabulary by repeatedly merging the most frequent adjacent pair; byte-level BPE encodes any input losslessly with 32k-200k tokens.
Data loading pipelines
mediumTurn files on disk into shuffled, sharded, resumable GPU batches fast enough that the accelerator never waits.
Near-duplicate detection with MinHash LSH
mediumEstimate set Jaccard similarity from k min-hashes and find similar pairs with banded LSH buckets; the standard dedup for web crawls, training corpora and sequence collections.
Data augmentation
lowGenerate label-preserving variants of each training example on the fly to enlarge the effective dataset and bake in invariances.
symmetry data augmentation
Planned.
active learning
Planned.
Negative sampling
lowTrain by contrasting each observed positive with a few sampled negatives instead of normalising over every candidate; the choice of sampler decides bias and quality.
Feature store
mediumOne definition per feature feeds a history store for training and a latest-value store for serving, so training and inference see the same values as of the same moment.
Classical ML
Often the right tool, and much cheaper.
Linear and logistic regression
lowFit a weighted sum of features to a number (least squares) or a probability (logistic); the baseline every model must beat.
Gradient-boosted decision trees (GBDT)
mediumAdd small regression trees one at a time, each fitted to the loss gradient; histogram splits over 256 bins make it the strongest tabular default.
k-means clustering
lowPartition points into k clusters by alternating nearest-centroid assignment and centroid averaging; k-means++ seeding makes it dependable.
PCA and SVD
lowFind orthogonal directions of maximum variance by an SVD of the centred data; randomized SVD gets the top k components in a few passes.
Naive Bayes classifier
lowCount how often each feature occurs per class and score a new item by summed log-likelihoods; trains in one pass, updates and merges by adding counts.
Isolation forest
lowScore each record by how few random axis-aligned splits it takes to isolate it in a small forest of random trees; anomalies are few and different, so they isolate fast.
Density-based clustering (DBSCAN)
mediumGroup points that are packed densely, label the rest as noise: no k, arbitrary shapes, two parameters (eps, minPts), cost set by the neighbour index.
gaussian processes
Planned.
Generalized linear models (GLMs)
mediumLinear model for counts, rates, positive amounts and proportions: a linear score pushed through a link, fitted by iteratively reweighted least squares.
quantile regression
Planned.
ftrl online learning
Planned.
Feature hashing (the hashing trick)
lowHash each feature name to an index in a fixed-size vector, with a second hash for the sign, so no vocabulary is needed and memory is fixed.
weight of evidence binning
Planned.
belief propagation
Planned.
Reinforcement learning
Learning from reward instead of labels.
Q-learning and DQN
mediumLearn action values by bootstrapping toward r + γ·max Q(s′, ·); DQN adds a replay buffer, a frozen target network and Huber loss.
Policy gradient and PPO
mediumRaise the log-probability of actions in proportion to their advantage; PPO clips the probability ratio so several epochs on one rollout stay safe.
AlphaZero self-play
mediumA policy-value net guides PUCT search; search visit counts and game results become its training targets, so it learns from its own improved play.
experience replay
Planned.
imitation learning
Planned.
domain randomization
Planned.
action chunking
Planned.
action tokenization
Planned.
off policy evaluation
Planned.
Multi-armed bandits
mediumChoose among K options repeatedly while learning their payoffs: epsilon-greedy, UCB1 and Thompson sampling keep total regret low where a fixed split or a fixed exploration rate pays forever.
Evaluation
Knowing whether a model is actually better.
Evaluation metrics
lowPrecision, recall, ROC AUC, average precision, log loss, NDCG and pass@k computed correctly, plus paired confidence intervals for comparing models.
Calibration
lowMake predicted probabilities match observed frequencies: measure with ECE, fix post hoc with temperature, Platt or isotonic scaling on held-out data.
LLM-as-judge
mediumGrade open-ended outputs with a language model under a rubric, then correct its known biases by order swapping, voting and calibration against human labels.
pass at k
Planned.
loglikelihood scoring
Planned.
fairness metrics
Planned.
shapley values treeshap
Planned.
benchmark contamination detection
Planned.
distribution drift detection
Planned.
Recommendation & ranking
Retrieving and ranking items for users, and modelling what they will remember.
Two-tower retrieval
mediumTwo separate encoders map users/queries and items into one vector space; item vectors are precomputed and searched by nearest neighbour, so recall over millions costs one small forward pass.
Learning to rank
mediumTrain a scorer on query-grouped data so that the order it induces maximizes NDCG; LambdaMART (boosted trees with NDCG-weighted pair gradients) is the production default.
Matrix factorization for collaborative filtering
mediumLearn a short latent vector per row and per column from the observed cells only; a missing cell is predicted by the dot product of its two vectors.
Deep ranking models for recommendation
mediumEmbedding tables plus a feature-interaction net predict several feedback signals per candidate; a weighted sum of them is the ranking score.
Click-probability prediction (CTR models)
mediumLearn p(action | user, item, context) from hashed categorical features with interaction terms (FM, Wide & Deep, DCN, DLRM), then keep it calibrated, since downstream multiplies it.
knowledge tracing
Planned.
spaced repetition
Planned.
Vision models
Detecting, segmenting, tracking and recognizing things in images and point clouds.
Object detection
mediumA network turns an image into scored, classified boxes in one pass; anchor-based, anchor-free and set-prediction heads differ in how they assign labels and remove duplicates.
Non-maximum suppression
lowKeep the best-scoring candidate in each neighbourhood and drop the rest; greedy NMS, Soft-NMS and 1-D peak picking share one loop.
image segmentation
Planned.
Multi-object tracking
mediumTurn per-frame detections (camera boxes or radar plots) into persistent IDs by predicting each track, gating, assigning and managing track births and deaths.
bev perception
Planned.
point cloud processing
Planned.
face embeddings
Planned.
facial landmark alignment
Planned.
liveness detection
Planned.
biometric template matching
Planned.
image forensics
Planned.
trajectory prediction
Planned.
Document understanding
Getting text and structure out of scans, PDFs and web pages.
Optical character recognition (text recognition)
mediumFind text lines in an image, read each crop with a CTC or attention model, then correct with a lexicon and score confidence for review routing.
layout analysis
Planned.
table structure recognition
Planned.
Document image preprocessing
lowTurn a scan or phone photo into an upright, evenly lit, binarised or normalised grey page so layout analysis and OCR read it reliably.
PDF text extraction
lowRebuild words, lines, columns and reading order from the glyph positions a born-digital PDF stores, and route pages without usable text to OCR.
HTML main-text extraction
mediumDecode bytes, tolerate broken markup, drop non-content nodes and score text blocks by length and link density to keep the main run, with headings, metadata and offsets for citation.
Text chunking
lowCut documents into token-bounded pieces along structure boundaries, keeping offsets and section paths, so each piece embeds well and can be cited.
Language processing
Classic NLP components: tagging, linking, classification, normalization, dialogue.
Named entity recognition
mediumFind the character spans of entities in text and give each a type, by labelling every token and decoding a valid label sequence.
Entity linking
mediumMap each mention to a knowledge-base id, or to NIL, by generating candidates from an alias table, scoring them on prior and context, and thresholding.
relation extraction
Planned.
Text classification
mediumAssign one or more labels to a text; climb a ladder from regexes to linear models on n-grams, embeddings, fine-tuned encoders and LLM prompts, only as far as the data and budget demand.
Language identification
lowScore a text's character n-grams against per-language statistics, after a cheap script check, and return an ISO 639 code with a confidence or "und".
Text normalization
lowRewrite messy text into one canonical form for matchers and models, or into spoken words for speech output (and back), keeping a map to the original offsets.
ngram language model
Planned.
back translation
Planned.
Template-based text generation
lowRealise facts as sentences by filling slots in alternative templates, with agreement, referring expressions and seeded variation; every word traces to data or a template.
Intent classification and slot filling
mediumTurn one utterance into an intent label and typed slot values with a joint model: a sentence-level classifier plus a token-level BIO tagger on a shared encoder.
Dialogue state tracking
mediumKeep a structured belief of the user's goal (slot → value, plus requests) and update it every turn from NLU output, the old state and the last system action.
Speech
Recognizing, segmenting and synthesizing speech.
Voice activity detection
lowPer-frame speech/non-speech decision with smoothing, from an energy threshold over a tracked noise floor up to small neural nets.
end of turn detection
Planned.
wake word detection
Planned.
RNN transducer (RNN-T)
mediumStreaming sequence model that sums all monotone alignments in a frame-by-label lattice and conditions each label on earlier ones.
Connectionist temporal classification (CTC) loss
lowAlignment-free sequence loss that sums the probability of every frame-to-label alignment with a blank symbol, using a dynamic program.
chunked streaming attention
Planned.
forced alignment
Planned.
speaker diarization
Planned.
speaker embeddings
Planned.
grapheme to phoneme
Planned.
neural vocoders
Planned.