ML vs Deep Learning
By the end you can place any problem in the right learning paradigm, state precisely what "generalization" means, explain what deep learning actually changed — learned features instead of hand-crafted ones — and say honestly why it took off when it did.
01 · What is machine learning?
Learning rules from data
Classic software writes the rules by hand: if this, then that. That works when a human can articulate the rule — but nobody can write down the explicit rules that separate a cat from a dog in a grid of pixels, or that turn an audio waveform into words.
Machine learning inverts the pipeline. Instead of programming the rules, we hand the computer data and a goal, and let it infer the rules itself. Tom Mitchell’s 1997 definition makes this precise enough to test every technique against:
Mitchell's definition
A program learns from experience E with respect to a task T and performance measure P if its performance on T, as measured by P, improves with E.
The three letters are worth pinning down, because the rest of the course is just filling them in:
- T
- the task you actually care about — classification (assign a discrete label), regression (predict a number), clustering, generation, control…
- P
- the performance measure — accuracy, error, likelihood, reward. This is what we optimise, and what we are graded on.
- E
- the experience the model learns from. Its nature — labelled data, unlabelled data, or interaction with an environment — defines the learning paradigm in the next section.
The power of this framing is its generality: E can be almost anything. The catch is P — without a good performance measure on the right data, a model can ace what it has already seen and fail on everything new. That failure mode, generalization, is the thread running through this whole course.
02 · The three paradigms
Supervised, unsupervised, reinforcement
The paradigm is set by the nature of the experience E — and identifying it is the first design decision for any problem you meet:
🎯 Supervised
Labelled pairs . Learn a function by comparing predictions to known targets. Splits into classification (discrete ) and regression (continuous ).
🔍 Unsupervised
Unlabelled inputs only. Discover hidden structure: clustering, dimensionality reduction, density estimation, and anomaly detection.
🎮 Reinforcement
State–action–reward. An agent maximises cumulative reward by trial and error; feedback is delayed and evaluative, not a label. Game playing, robotics, control.
The dividing line is what feedback the model gets per example: an exact target (supervised), nothing but the inputs (unsupervised), or a scalar reward that may arrive many steps later (reinforcement).
Two orthogonal axes (exam trap)
The learning paradigm (supervised / unsupervised / RL) is independent of the architecture (deep / shallow). A deep autoencoder is unsupervised; a deep CNN classifier is supervised; shallow -means is unsupervised. Note too that anomaly / outlier detection is unsupervised — there are no anomaly labels to learn from — even though it sits conceptually next to classification.
Exam · 2024 Q1 — does it need supervision?
For each task, decide whether it can be trained unsupervised or necessarily needs a human labeler:
- A driving net that locates pedestrians and cars in the image → Supervised — the object locations cannot be derived from the raw image; an expert must annotate them.
- Image restoration / inpainting (restore obscured pixels) → Unsupervised (self-supervised) — masking the image creates its own target, no human labels needed.
- Tell whether a cow is of the Frisona breed → Supervised — the breed label is external knowledge.
- Predict the next “acqua alta” event from a 20-year series → Unsupervised — the target (the next value) is taken from the series itself by shifting it.
Rule of thumb: supervision is required exactly when the target cannot be manufactured from the data itself. “Time-series prediction is always supervised” is the classic wrong answer.
Now try it yourself — the same past-paper question, interactive. Match each task, then check your answer:
03 · The learning problem
Empirical risk and the bias–variance trade-off
Formally, a learner searches a hypothesis space for the function that minimises the expected loss over the true (unknown) data distribution. We can never compute that expectation — we only ever have a finite sample — so we minimise the empirical risk, the average loss on the training set, as a proxy:
Minimising training loss is a stand-in for minimising true loss. The gap between them is the whole game — and it is governed by how rich is.
That gap is the bias–variance trade-off — the central tension that Chapter 03 then attacks with regularisation:
📉 High bias (underfit)
is too restrictive to capture the pattern. Training and test error are both high.
📈 High variance (overfit)
is so flexible it memorises noise. Training error is low, test error is high.
✓ Good generalization
Both errors are low and close together. The sweet spot we tune toward.
A model is a student revising for an exam
Underfitting = skimmed the material and learned nothing. Overfitting = memorised last year’s answer key word-for-word, then froze when the questions changed. What we want is transferable understanding — low error on the new paper, not the one already seen.
04 · What deep learning changed
Learned, hierarchical features — not hand-crafted ones
For decades, “pattern recognition” was a two-stage pipeline: a human expert designed a feature extractor, and a (usually simple) learning algorithm sat on top of it. The intelligence lived in the hand-designed features; the learner merely drew a boundary.
- Object recognition: raw image → hand-crafted descriptors (SIFT, HOG, bag-of-visual-words) → SVM classifier.
- Speech recognition: raw waveform → spectrogram → MFCC features → Gaussian-mixture / HMM model.
The bottleneck is obvious in hindsight: features were the hard part, and they were built by hand, one domain at a time, by specialists. They were brittle and they didn’t transfer.
The core shift
Deep learning collapses the two stages into one trainable system: the network learns the features and the task together, end-to-end, directly from raw inputs. This is representation learning — the model discovers its own features instead of being handed them.
And the features it discovers are hierarchical. In a vision network, early layers learn generic edges and colour blobs; middle layers compose those into textures and motifs; deeper layers compose those into object parts (an eye, a wheel); the top layers respond to whole objects. Each layer builds a more abstract representation out of the previous one — exactly the structure a human engineer could never hand-design but data can:
You’ll watch this chain climb in the hands-on widget below — and meet it again in every CNN chapter.
What the 'deep learning revolution' actually was
It was learning data-driven, hierarchical features instead of relying on expert-designed ones — not merely “it became computationally possible to train many layers” (a recurring exam distractor). Compute and data enabled the shift; the shift itself was conceptual.
Peek ahead If one hidden layer can already approximate anything, why go deep?
The universal approximation theorem says a single hidden layer with enough units can approximate any continuous function on a compact set to arbitrary accuracy. So expressive power is not the reason for depth — “enough units” can be astronomically large. Depth wins because it lets a network reuse and compose features: the same function that needs exponentially many units in a shallow net can be represented compactly by a deep one, and the composed features are easier to learn from finite data. Expressiveness was never the bottleneck; parameter efficiency and learnability are. We build the machinery in Chapters 02–03.
05 · Why it took off when it did
What’s behind the deep learning revolution
The core ideas — neurons, backpropagation, convolution — date to the 1980s and earlier. So why did deep learning explode around 2012 and not 1992? Three enablers arrived together:
🧮 Computational power
GPUs. Training is mostly matrix multiplication, which GPUs do in massive parallel. A model that took weeks on a CPU now trains in hours — making deep nets practical to experiment with.
🗄️ Big data
Labelled datasets at scale (ImageNet: ~1.2M labelled images, 1000 classes). High-capacity models only generalise when fed enough examples; the internet finally supplied them.
🔧 Algorithms & tooling
ReLU, Dropout, BatchNorm, Adam, good initialisation, and autodiff frameworks (TensorFlow, PyTorch) that made deep nets trainable and easy to build.
The watershed was AlexNet winning the 2012 ImageNet challenge by a huge margin — a deep CNN on GPUs trouncing the hand-crafted-feature pipelines that had topped the leaderboard for years. The lesson the field drew: given enough data and compute, learned features beat designed ones. (We return to AlexNet’s design in Chapter 09.)
Hold both ideas at once
Compute + data were necessary enablers, but they are not what deep learning is. The conceptual content is “learn the representation”; the enablers are why we could finally afford to. Keeping these two apart is exactly what the exam’s true/false questions test.
06 · Deep learning in the wild
What learned representations unlock
Once a network has learned a rich internal representation, it can be pointed at tasks far beyond plain classification. A few that motivate the rest of the course:
🎨 Neural style transfer
Re-render a photo in the style of a painting by separating an image’s content (deep feature activations) from its style (feature correlations) — a direct use of the feature hierarchy above.
🔍 Super-resolution
Hallucinate plausible high-resolution detail into a low-res image — the network has learned what real textures look like.
🗣️ Speech & language
End-to-end speech recognition, machine translation, and text generation (Chapters 04–05).
🖼️ Dense vision
Detection, segmentation, captioning, pose estimation (Chapters 06–12).
The recurring pattern across all of them: a learned hierarchy of features is a reusable substrate. The same backbone that classifies images can be repurposed to localise, segment, retrieve, or restyle them — which is why so much of this course is about understanding that backbone deeply rather than memorising one task.
The course map
Chapters 02–03 build and train the basic network; 04–05 handle sequences and text; 06–12 build the vision stack (classification → CNNs → transfer learning → architectures → segmentation → detection). Everything rests on the single idea introduced here: learn the representation from data.
07 · Hands-on
Try it yourself
Two widgets, each drilling in one idea from above. Click, sort, and step through — these are the moments where the abstractions turn into instincts.
Sort the scenarios into paradigms
For each real-world problem, decide whether it is best framed as SL supervised, UL unsupervised, or RL reinforcement learning. The button you click turns green if correct, red if not — and a short explanation appears.
Climb the feature hierarchy
Step through the layers of a vision network. Notice how each level is built out of the one below it — edges from pixels, textures from edges, parts from textures, objects from parts. Nobody designed these detectors; the network learned them from data.
Input Raw pixels — detects nothing yet — just a grid of intensities.
The network sees only numbers: one (or three) values per pixel. No notion of "edge" or "cat" exists at this point — everything above is built from here.
08 · Exam intel
What the exam actually tests
This chapter is light on derivations and heavy on placing things correctly. Questions cluster into a few predictable shapes.
Decide the paradigm — and justify with E
A task is described; you classify it as supervised / unsupervised / reinforcement and justify with the shape of the experience . The decisive test is whether the target can be manufactured from the data (forecasting, inpainting → unsupervised) or must be supplied by a human (object locations, breed labels → supervised). The cheap answer (“it has labels”) earns few marks; reference explicitly.
True/False on the 'deep learning revolution' (2026 Q6)
Two statements appear almost every year, both false:
- “The deep-learning revolution is that it became computationally possible to train many-layer networks.” → False. The essence was learning data-driven, hierarchical features end-to-end; compute merely enabled it.
- “Regression, classification and anomaly detection are all supervised tasks.” → False. Anomaly detection is typically unsupervised — it models “normal” without labels.
Both test the same instinct: separate what deep learning is from why it became affordable, and remember that lacking labels makes a task unsupervised.
Paradigm vs architecture are orthogonal
Given “a deep autoencoder” or “a deep CNN classifier”, state the paradigm. Depth is an architecture choice and says nothing about : the autoencoder is unsupervised (reconstructs its own input), the CNN classifier is supervised (trained on labels). Mixing these two axes is the most common slip.
09 · Common mistakes
Where students get this wrong
"Deep learning just means many layers / more compute"
Depth and GPUs are the means, not the idea. The conceptual change was learned, hierarchical representations replacing hand-crafted features. Compute and big data are why it became practical — keep that strictly separate from what it is.
"Anomaly detection is supervised"
It sits next to classification, but with no labelled anomalies there is nothing to supervise on. You model the distribution of normal data and flag the rest — that is unsupervised (2026 Q6).
Confusing the paradigm with the architecture
“Deep” is a family of techniques, not a paradigm. A deep net can be supervised, unsupervised, or part of an RL agent. The paradigm is fixed by the experience E, the architecture by how you wire the layers.
"Low training error means the model is good"
Training error tells you only how well the model learned what it has already seen. A flexible network can drive it to zero by memorising noise. The number that matters is error on held-out data — that’s the generalization the whole course is about.
"Time-series prediction is always supervised"
The target — the next value — is taken from the series itself by shifting it. No human labels are created, so next-step forecasting is self-supervised, i.e. unsupervised in the exam’s taxonomy.
10 · Self-check
Can you answer these?
Three short questions that mirror how the chapter gets tested. Click an option for instant feedback.
What was the essential change behind the 'deep learning revolution'?
You must flag anomalous credit-card transactions, but no past fraud has ever been labelled. Which paradigm fits best?
A deep CNN classifier and a deep autoencoder are both 'deep'. What does that tell you about their learning paradigm?
11 · Recap
One-screen summary
Chapter 01 — load-bearing ideas
- ML learns rules from data. Mitchell: performance P on task T improves with experience E. A good P on the right data is what keeps a model honest — and generalization is the central challenge.
- Three paradigms, sorted by the nature of E. Supervised (labelled targets), unsupervised (structure — including anomaly detection), reinforcement (delayed scalar reward).
- Paradigm and architecture are orthogonal. “Deep” is a family of techniques, not a paradigm.
- We minimise empirical risk as a proxy for true risk. The richness of drives the bias–variance trade-off: underfit (high bias) ↔ overfit (high variance) ↔ good generalization.
- Deep learning’s real change is learned, hierarchical features (edges → textures → parts → objects) replacing hand-crafted ones. Compute (GPUs) and big data (ImageNet) enabled it but are not its essence.
- AlexNet (2012) was the watershed: learned features beat designed ones once data and compute were sufficient.