The purpose of this class is to
learn how to learn. In fields that move this
fast, papers are the medium, not textbooks.
scholar-inbox.com,
plus YouTube, blogs, and whatever else keeps you current
The simple formula: read a paper, clone the repository,
reproduce the result, come back with a question
Main deliverable: a presentation and a paper
Finding constants of Nature That Generalize Across Space and Time
Galileo
Kepler
Descartes
Galileo's cartoon says the quiet part
out loud: "It shouldn't happen this way. I'll have to alter the data."
From the World to a Model, and Back
The Three Pillars of Artificial Intelligence
The world is messy. The question is simple:
what is the shortest way home?
Modeling
Throw the city away. Keep junctions and the
cost of each road.
Learning
You are not given the costs. You estimate them
from journeys people already made.
Inference
With a model in hand, answer the question you
actually asked.
The Same Three Pillars, for a Field
Now the world is a field \( u(x, t) \): a temperature, a wind speed, a
concentration, known at some places and times.
Modeling\( \dfrac{\partial u}{\partial t} = \mathcal{L}\big(u(x,t);\, p\big) \)choose the form of the law, with unknown parameters \(p\)
Learning\( \hat{p} = \arg\min_{p} \Big\| \dfrac{\partial u}{\partial t} - \mathcal{L}\big(u(x,t);\, p\big) \Big\|^2 \)find the parameters that make the law fit the data
Inference\( u(x_j, t_{i}) = \mathrm{Integrator}\big(u(x_{j-1}, t_{i-1}),\, u(x_j, t_{i-1}),\, u(x_{j+1}, t_{i-1})\big) \)step the learned law forward to predict the next moment
SINDy, PINNs and neural operators, later in the course, are three
different answers to the Learning row.
The Data Science Hierarchy of Needs
AI, deep learning
learn / optimize
A/B testing, experimentation, simple ML algorithms
aggregate / label
analytics, metrics, segments, aggregates, features, training data
explore / transform
cleaning, anomaly detection, preparation
move / store
reliable data flow, infrastructure, pipelines, ETL, structured and unstructured storage
After Monica Rogati, The AI Hierarchy of Needs (2017).
Five of the six layers are not machine learning: they are getting, moving and cleaning the data.
What are* data?
Anything the world leaves behind that we can record.
numberssoundimagesvideolanguagegamesnetworks
Today: all of these become numbers.
*one datum, many data
Stocks
hover a row
A table and a curve: the same object
Each row is a pair \( (t_i, x_i) \): 123 months, 123 numbers
Monthly closing prices in US dollars, January 2000 to March 2010, as published in the
vega-datasets collection.
Temperature
Global surface temperature, as the difference from the 1951 to 1980 average
The warmest year in the record is 2024, at +1.28 °C. Every
year since 2015 is warmer than any year before it.
NASA GISTEMP v4, annual means 1880 to 2025, via
datasets/global-temp. Hover the bars or the table.
Audio
hover the waveform to zoom in · 22,050 numbers per second (a CD stores 44,100)
Speech recognition is a function \( F: \text{array} \rightarrow \text{text} \):
Siri (2011), Alexa (2014), Google Assistant (2016)
Four seconds of Heather Barnett reading Sense and Sensibility, from the
LibriSpeech corpus (CC BY 4.0).
From a Wave to a Picture
The short-time Fourier transform: the first thing anyone
does to a sound before modelling it
Cut the signal into short windows, take the Fourier
transform of each, stack them side by side. Now pitch is visible.
The voice stops at 8 kHz: it was recorded at 16,000 samples per second, and
no recording holds frequencies above half its sampling rate.
Speech recognisers and birdsong classifiers almost
never see the wave. They see this picture.
Robin: InspectorJ, freesound (CC BY 3.0) · whale: Chris Gabriele, Glacier Bay NPS, 2020 (public domain) · voice: LibriSpeech (CC BY 4.0)
Images
move your mouse over the image: every pixel is one number from 0 (black) to 255 (white)
This grey image is a \( 330 \times 330 \) matrix: 108,900 numbers
Your phone: \( 3000 \times 4000 \times 3 = 36 \) million numbers per photo
Astronaut Eileen Collins, NASA portrait (public domain), as shipped with scikit-image.
Colour Is Three Matrices
The grey image was one number per pixel. Colour is three, stacked
click the photo to move the 4 by 4 patch
A colour image of height \(h\) and width \(w\) is an
array of shape \( h \times w \times 3 \).
Nothing about it is a picture to the machine. It is
three grids of numbers between 0 and 255.
Image Recognition, and What Came After
2010 Google announces its self-driving car project (Waymo since 2016)
2011 IBM Watson beats Ken Jennings and Brad Rutter at Jeopardy!
2012 Deep networks overtake the best speech recognisers (Hinton et al.)
2012 Google Brain learns to find cats in 10 million unlabelled YouTube frames
2012 AlexNet: ImageNet top-5 error falls from 26% to 15%
2014 DeepFace matches faces at 97.35% (people: 97.53%)
2016 Diabetic retinopathy graded from retina photos at specialist level
2019 Lung cancer screening CT read as well as six radiologists
2020 AlphaFold 2 predicts protein structure from sequence (CASP14)
2022 DALL-E 2 and Stable Diffusion turn text into images; ChatGPT
2024 One model reads text, images and sound together; text becomes video
None of these people exist. GANs were introduced by Goodfellow et al. in 2014; these faces are from Karras et al.,
Progressive Growing of GANs for Improved Quality, Stability, and Variation (ICLR 2018).
Video
1959 · Arthur Samuel's checkers
program at IBM learns from its own games. His paper that year names the field: machine learning.
1997 · IBM Deep Blue beats world
champion Garry Kasparov, 3.5 to 2.5. It searched about 200 million positions a second.
2016 · DeepMind's AlphaGo beats
Lee Sedol, 4 games to 1. Go cannot be searched; it learned what good positions look like.
Solving Puzzles: How Big Is the Search?
Past about \(10^{20}\), nothing is solved by listing positions.
Past \(10^{80}\), there are not enough atoms in the universe to write them down.
You have to learn the structure instead.
Counts: Tromp (Connect Four, chess, Go); Schaeffer et al., Science 2007 (checkers);
Rokicki et al. 2010 (Rubik's cube); Felgenhauer and Jarvis 2005 (sudoku); Shannon 1950 (chess games).
Graph Representation
click two nodes: the matrix follows
Maps, molecules, social networks: all matrices, \( A_{ij} = 1 \) when \(i\) connects to \(j\)
\( r_{ij} = \mathrm{Cov}(X_i, X_j) / (\sigma_{X_i} \sigma_{X_j}) \): every pair at once, the diagonal all ones.
Click a cell to see its pair.
simpson's paradox
All penguins together: longer bills are shallower, \( r = -0.24 \). Inside every species: longer bills are deeper, \( r = +0.39 \) to \( +0.65 \).
Palmer Penguins: Gorman, Williams and Fraser (2014), Palmer Station LTER; 342 birds with all four measurements.
Histogram and Probability Density Function
key distinction
The histogram is data.
The curve is a model: a gaussian with the data's mean and spread.
It fits the heights, and fails the prices and the seasons.
Galton (1885), 928 children, inches; De Cock (2011), 2,930 Ames sales; Open-Meteo ERA5, Beirut, 4,018 days of 2015 to 2025.
Box and Whisker Plot
body mass of the Palmer penguins, grams
Five numbers instead of a histogram: minimum, lower quartile,
median, upper quartile, maximum. Half the birds sit inside each box.
Asked: a language model will name
datasets you would not have found, and invent ones that do not exist.
Check every link it gives you.
import pandas as pd
url = "https://raw.githubusercontent.com/mwaskom/seaborn-data/master/penguins.csv"
df = pd.read_csv(url)
print(df.shape) # (344, 7): 344 penguins, 7 measurements
print(df.describe()) # your first look at any dataset
How Do You Come Up With Project Ideas?
Start from something you already care about, then go looking for whether
anyone has measured it
Search properly: Google,
Google Scholar, and ask a model to argue
with you about it
Read a paper, clone the repository, reproduce the result.
The gap between what the paper claims and what the code does is where
the project ideas live.
A good idea names its data
before it names its method.
Next session
Data is the interface between the world and the model.
Thursday: the math and Python toolkit.
Before then: PS0, and run the penguins line yourself.