Module 12
Unsupervised Learning and Representation Learning
How can an algorithm discover useful structure, patterns and representations without explicit labels?
- lessons
- 24
- duration
- 40 h 30 min
- concepts
- 127
- available in English
- 24 / 24
- completed by you
0 of 24
Where it fits
Prerequisites
Overview
Explore the major families of learning without labels: clustering (k-means, hierarchical, density-based and spectral); mixture models and the EM algorithm, derived generally through its lower bound; linear dimensionality reduction (PCA and its high-dimensional theory, probabilistic PCA, factor analysis, ICA, NMF and dictionaries); nonlinear reduction (MDS, Isomap, spectral methods, t-SNE and UMAP); density estimation and anomaly detection; and self-supervised and contrastive learning with InfoNCE as the theoretical core. Each method is derived, implemented from scratch in NumPy or PyTorch, and compared with a reference library. A spectral thread connects spectral clustering, diffusion maps, neighbor embeddings and modern contrastive-learning theory.
Why it matters
Most real data arrives without labels: telemetry and security logs, market time series, robot trajectories and text. This module provides tools to discover structure by segmenting, compressing, visualizing without misleading yourself and detecting anomalies, with applications in security and quantitative risk. It also underpins self-supervised pretraining behind GPT, CLIP, DINO and robotic world models. EM and its lower bound prepare variational inference and VAEs, while high-dimensional PCA and factor analysis are everyday quantitative tools.
Lessons 24
- 01Learning without labels: tasks, dissimilarities and data geometryUnsupervised learning questions and their geometry, mixed-data dissimilarities, hubness and intrinsic dimension.
- 02k-means and vector quantizationThe k-means objective, Lloyd's algorithm, k-means++ initialization, vector quantization and alternatives.
- 03Hierarchical clusteringHierarchical clustering, linkage criteria, dendrograms, minimum spanning trees, Ward's criterion and efficient implementations.
- 04Nonparametric density estimation and mean shiftNonparametric density estimation, bandwidth selection, nearest-neighbor estimation and mean shift clustering.
- 05Density-based clustering: DBSCAN, OPTICS and HDBSCANDensity level-set clusters, DBSCAN, OPTICS and HDBSCAN, including variable-density hierarchies and stability.
- 06Spectral clusteringSpectral clustering as graph cuts relaxed to Laplacian eigenvectors, and its connections to spectral embeddings.
- 07Evaluating a clusteringInternal and external clustering validation, selecting cluster count, stability and Kleinberg's impossibility theorem.
- 08Gaussian mixture modelsGaussian mixture models, expectation-maximization, numerical stability, model selection and the k-means limit.
- 09The EM algorithm in general: lower bound, monotonicity and convergenceExpectation-maximization through the evidence lower bound, convergence, variants and missing data.
- 10Principal component analysisPrincipal component analysis through variance maximization, reconstruction, SVD and practical implementation.
- 11High-dimensional and robust PCA: noise, rank and outliersHigh-dimensional PCA, noise spectra, signal detection, covariance estimation and robust PCA.
- 12Probabilistic PCA and factor analysisProbabilistic PCA, linear Gaussian latent models, factor analysis and expectation-maximization.
- 13Independent component analysisIndependent component analysis, identifiability, whitening and separation algorithms.
- 14Non-negative matrix factorization, sparse coding and dictionary learningNonnegative matrix factorization, sparse coding and dictionary learning.
- 15Multidimensional scaling, kernel PCA and IsomapMultidimensional scaling, kernel PCA, Isomap and embedding quality.
- 16LLE, Laplacian eigenmaps and diffusion mapsLocal spectral methods use neighborhood reconstruction or connectivity; diffusion maps add time. Derive and unify these methods as data-built kernel PCA, then embed new points with Nyström.
- 17t-SNE: stochastic neighbor embeddingBuild t-SNE from neighborhood probabilities, perplexity, KL divergence and a heavy-tailed kernel, then study optimization and how to interpret its plots.
- 18UMAP and the attraction-repulsion spectrumBuild UMAP's fuzzy graph, cross-entropy objective and negative-sampling optimization; compare effective loss and the attraction–repulsion spectrum, then study parametric embeddings.
- 19Unsupervised anomaly detectionUnify anomaly detectors as density, distance, isolation and reconstruction scores; compare robust Mahalanobis, LOF, Isolation Forest, One-Class SVM and PCA, with evaluation at low prevalence.
- 20Latent representations and self-supervised learningA representation is useful when it makes the tasks we care about easier. Relate PCA, dictionaries and embeddings to that idea, then study how self-supervised methods construct targets from the data themselves. Survey historical pretext tasks and modern methods, and set up linear-probe and k-NN evaluation used in the following lessons.
- 21Contrastive estimation: from NCE to InfoNCEContrastive learning has a statistical origin in learning to distinguish observations from noise. Start with noise-contrastive estimation, move through negative sampling and derive InfoNCE. Its optimal critic is a density ratio, and its value bounds mutual information from below. Study where that bound saturates and how t-SNE and UMAP perform contrastive estimation on a neighbor graph.
- 22Contrastive representation learning: views, augmentations and negativesUse two augmented views of one example as positive pairs and other examples in the batch as negatives. Study augmentations, projection heads, temperature, batch size, negative queues and momentum encoders. Relate the loss to alignment and uniformity on the hypersphere, and study hard and false negatives in local GPU experiments and ablations.
- 23Non-contrastive methods and representation collapseWithout safeguards, learning without negatives can collapse all representations to a constant. Explore complete and dimensional collapse and how predictors, stop-gradient and moving averages help BYOL and SimSiam. Study Barlow Twins and VICReg for redundancy reduction, DeepCluster and SwAV for clustering, and effective rank as a label-free diagnostic.
- 24Theory and frontier of self-supervised learningWhy does self-supervised learning work, and what can it guarantee? This lesson examines latent-class bounds, spectral contrastive loss, spectral embeddings and identifiability, then explores JEPA and convergence of representations.
Module capstone
End-to-end unsupervised atlas
Using Fashion-MNIST or a chosen telemetry or tabular-log dataset, build a reproducible report that: (1) trains a self-supervised encoder (SimCLR or VICReg) on the local GPU and compares it with raw pixels, PCA, NMF and dictionaries using a linear probe, k-NN and effective rank; (2) projects representations using PCA, t-SNE and UMAP and quantifies fidelity with trustworthiness and neighbor preservation; (3) clusters with k-means, a BIC-selected GMM and HDBSCAN, evaluating against held-out labels with ARI and AMI and measuring stability; (4) treats a held-out class as anomalous and compares Isolation Forest, LOF, GMM log likelihood and PCA reconstruction error using PR-AUC and precision at k; and (5) documents seeds, ablations and honest conclusions about which structure is real and which is an artifact of the method.
Check what you already know
- Estimate intrinsic dimension using TwoNN and explain how hubness affects neighbor-based methods.
- Prove that Lloyd’s algorithm does not increase inertia and implement k-means++.
- Relate single linkage to the minimum spanning tree and choose a linkage criterion.
- Derive an optimal KDE bandwidth and select it by cross-validation.
- Explain what HDBSCAN improves over DBSCAN when cluster densities vary.
- Derive RatioCut’s spectral relaxation and apply spectral clustering.
- Calculate ARI and AMI and recognize when silhouette scores mislead.
- Derive and implement numerically stable EM for a Gaussian mixture.
- Prove EM monotonicity via the lower-bound and KL-divergence decomposition.
- Calculate PCA via SVD and prove the equivalence of maximum variance and minimum reconstruction error.
- Choose which components are signal against the noise bulk using parallel analysis and the Gavish-Donoho threshold, and separate low rank from outliers with robust PCA.
- Explain why Gaussian sources are not identifiable in ICA and implement FastICA.
- Interpret t-SNE or UMAP plots correctly and measure preserved structure.
- Choose and evaluate an anomaly detector at very low prevalence.
- Derive InfoNCE as a mutual-information lower bound.
- Explain why BYOL or VICReg avoid collapse without negative examples.