Paul's Python CoursePPC

The syllabus

Nine Acts, 116 projects, about 410 hours, from a first print statement to an agent that wins at the Arcade. The first four Acts are Python and computer science; the next four are data, machine learning, deep learning and reinforcement learning; the last is capstone projects.

Act 1, ground floor

The Workshop

Foundations. About 25 hours, 14 projects.

Thirteen real programs in Paul's Workshop, from the door sign to the trip fund, for Neil's racing, Riya's art, Aaesha's experiments, Yahya's data and Caitlin's games. Printing, numbers, input, decisions, loops, lists, strings, functions, dictionaries and handling errors.

  1. Course Sign

    A first program: print the sign for the Clocktower's front door.

    For Paul, about 20 minutes

    • Programs run top to bottom
    • print() shows things
    • Strings are text in quotes
    • Comments are notes for people
  2. Bill Splitter

    Split a bill between a table of people, tip included, and show every share to the penny.

    For Caitlin, about an hour and a half

    • Arithmetic
    • Which sum goes first
    • Variables are labels on boxes
    • Honest names
    • input() gives you text
    • int() makes whole numbers
    • float() makes decimal numbers
    • f-strings
    • type() says what kind of value
  3. Reading Tracebacks

    Five broken racing and rocket scripts from Neil's first term, and the four errors every Python programmer meets.

    For Neil, about 45 minutes

    • Reading a traceback
    • SyntaxError
    • NameError
    • TypeError
    • ValueError
    • str() makes text
  4. Unit Converter

    A menu that converts racing, flying and rocket speeds, so Neil can compare an F1 car with a jet.

    For Neil, about 50 minutes

    • True and False
    • Comparisons
    • if, elif and else
    • An if inside an if
  5. Password Checker

    Six rules for the server that holds Aaesha's experiment results, and a reason for every one a password breaks.

    For Aaesha, about 55 minutes

    • String methods
    • Slicing strings
    • Strings can't be changed
    • strip() and replace()
    • and, or, not
    • in
  6. Times Table Trainer

    Any times table from 1 to 12, lined up neatly, then a quiz on the hard end, for Aaesha's memory experiment.

    For Aaesha, about 60 minutes

    • for loops
    • range
    • The loop variable
    • Tracing a loop
  7. Number Guessing Game

    The computer picks a number from 1 to 100. You guess, and it counts every try.

    For Caitlin, about 70 minutes

    • while loops
    • Sentinels
    • Running totals and counters
    • Loops that never end
    • Random numbers
    • import
    • break and continue
  8. To-Do List

    Add, list, tick off and quit: Riya's commissions, numbered and kept in the order people asked.

    For Riya, about an hour and a half

    • Lists
    • Indexes start at 0
    • Counting from the end
    • append and pop
    • Looping over a list
    • List methods change the list
    • Slices take part of a list
    • sorted() and .sort()
    • Two labels, one list
  9. Contact Book

    Riya's clients and suppliers: look people up, find them from half a name, and add new ones from one typed line.

    For Riya, about 70 minutes

    • Dictionaries
    • .get() for keys that might not be there
    • Looping over a dictionary
    • Dictionaries inside dictionaries
    • split() and join()
  10. Grade Calculator

    Marks for the class's first Python test in, averages and letter grades out, built from small functions that each do one job.

    For Paul, about 70 minutes

    • Functions
    • Parameters
    • Return values
    • None
    • Scope
  11. Rock Paper Scissors

    Rock paper scissors against the computer, first to three: functions, random choices and a score dictionary in one whole game.

    For Caitlin, about 55 minutes

  12. Four-Function Calculator

    Type a sum as text, get the answer, and survive bad input with try and except, until quit.

    For Yahya, about 70 minutes

    • Exceptions
    • try and except
  13. Expense Tracker

    The Act I capstone: a menu-driven expense tracker, built from a list of dictionaries and functions.

    For Yahya, about 3 hours

  14. Python at HomeSidequest

    Set Python up on your own computer: a terminal, an editor, a virtual environment and pytest, proved by a small program and its tests.

    For Neil, about 45 minutes

    • The terminal
    • Virtual environments

Act 2, floor 1

The Studio

Fluent Python. About 45 hours, 20 projects.

Twenty programs on Caitlin's floor, from passwords for the game server to a personal finance app, with a quiz night, a bake sale, a festival fund, Neil's race log and Aaesha's reading experiment on the way. Tuples, sets, files, JSON, exceptions, comprehensions, modules, classes, tests, generators, decorators, the command line and git.

  1. Password Generator

    Passwords and passphrases for the Studio's Friday-night game server: sensible defaults, options by name, and nothing anyone can guess.

    For Caitlin, about an hour and a half

    • Default arguments
    • Keyword arguments
    • *args and **kwargs
    • The mutable default trap
    • Docstrings
  2. Measurement Book

    The measurement book for the Clocktower's five-a-side kit: each player's numbers kept together in a tuple, every line numbered, and the longest leg found.

    For Caitlin, about 50 minutes

    • Tuples
    • Unpacking
    • Returning several values
    • enumerate()
    • zip()
  3. Lost Property Matcher

    Match what was left behind after the Studio's game nights against what people have asked about, counting every umbrella once.

    For Caitlin, about 50 minutes

    • Sets
    • Comparing sets
    • How fast is in?
  4. Word Counter and Text Analyser

    Count every word in a real book for Aaesha's reading experiment, report the ten it uses most, and save every count to a file a spreadsheet can open.

    For Aaesha, about an hour and a half

    • Reading and writing files
    • with blocks
    • Paths
    • The csv module
    • Counting with Counter
  5. File OrganiserBeing written

    Caitlin's downloads folder, four hundred files deep in songs, game saves, photos and recipes, sorted into folders by type with pathlib: a pretend folder in the browser first, then a real one on your own computer.

    For Caitlin, about an hour and a half

  6. Log Analyser

    Count the errors in the flight log every system on Neil's drone writes to, and survive the lines that make no sense.

    For Neil, about 60 minutes

    • Raising errors
    • Defensive input
  7. Habit TrackerBeing written

    Caitlin's daily guitar practice and daily Drill, ticked off and remembered: dates with datetime, a JSON file saved and loaded, streaks, and a plan for the day the file is broken.

    For Caitlin, about an hour and a half

  8. Quiz App

    Caitlin's Thursday quiz night, with rounds on music, food and games: questions in a JSON file, shuffled every week, asked, marked and scored, mostly with lists made out of other lists.

    For Caitlin, about an hour and a half

    • List comprehensions
    • Set and dictionary comprehensions
    • Comprehensions with if
    • JSON and the json module
  9. Opening Hours Module

    One module of opening-hours helpers, imported by every floor of the Clocktower, and Caitlin's board by the front door to show it off.

    For Caitlin, about 60 minutes

    • Modules
    • The main guard
    • The standard library
  10. Order Book

    Caitlin's bake sale stock numbers change on their own. Find out why, then build the order book that never touches the standing orders.

    For Caitlin, about 60 minutes

    • References
    • Mutable and immutable
    • Shallow and deep copies
    • is and ==
  11. Bank Account System

    Savings accounts for the class festival fund, each one a Python object that keeps its own balance and says no for itself.

    For Caitlin, about an hour and a half

    • Classes and objects
    • __init__
    • Attributes
    • Methods
    • self
    • Dunder methods
  12. Library Manager

    Loans and reference copies for Neil's racing and space books on the Studio shelves, with Yahya and Caitlin arguing about whether a library is a kind of list.

    For Neil, about 2 hours

    • Inheritance
    • super()
    • Composition
    • Dataclasses
    • Type hints
    • Enums
  13. Text Adventure EngineBeing written

    Caitlin's game about climbing the Clocktower floor by floor, as a text adventure: rooms in a dictionary of exits, a game loop, and everything the player carries kept in a class.

    For Caitlin, about 2 hours

  14. Testing the Bank

    Tests for Caitlin's festival fund accounts that pass on the real thing and fail on broken copies, then two new features written tests first.

    For Caitlin, about an hour and a half

    • assert
    • pytest
    • Edge cases
    • Writing tests first
  15. CSV Budget ReportBeing written

    A year of the bake sale's takings and costs arrives as a CSV file. Read it with the csv module, group it by month and category, and find the story Yahya says is in there.

    For Yahya, about an hour and a half

  16. Command-Line To-Do Tool

    Paul's to-do list for the course code, on the Workshop terminal: add, list and done, kept in a file between runs, and polite when it's used wrongly.

    For Paul, about an hour and a half

    • sys.argv, what was typed
    • Exit codes
    • argparse reads the command line
  17. Log Streamer

    Search Neil's sim-racing telemetry, too long to read all at once: a chain of generators that reads a line at a time and stops as soon as it has enough.

    For Neil, about an hour and a half

    • Iterators hand over one value at a time
    • Generators and yield
    • Lazy means worked out when asked
  18. Timing and Retry Decorators

    Two decorators for the till on the fruit table at Caitlin's bake sale: one times every call and finds the slow one, one tries the card reader again when it doesn't answer.

    For Caitlin, about an hour and a half

    • Functions are values
    • lambda, a function on one line
    • map and filter
    • Sorting with key=
    • Closures remember
    • Decorators
  19. Git and GitHub

    Keep the history of a project with git: commits, branches and a conflict in the browser, then a real repository of your own, pushed to GitHub.

    For Paul, about an hour and a half

    • Commits, staging and history
    • Branches and merging
    • Merge conflicts
  20. Personal Finance App

    The Act II capstone: Caitlin's personal finance app, the fun version, with budgets and monthly reports, in four modules with their own tests, taken home as a real package.

    For Caitlin, about 8 hours

Act 3, floor 2

The Makerspace

Real-World Python. About 40 hours, 10 projects.

Programs that talk to the world, from Riya's Makerspace on the second floor: a forecast for painting outdoors, a palette scraper, the paperwork behind her prints, games for the arcade cabinet in her pixel art, and a gallery and print shop you put online.

  1. Weather App

    A forecast for anywhere, for Riya's painting trip: ask a real weather service, read the JSON it sends back, cope when it goes wrong, and print three plain days.

    For Riya, about 2 hours

    • Calling a web API
    • Requests and responses
  2. Web ScraperBeing written

    A palette scraper: Riya wants the colours from a design site's palette pages, every hex code on one page of her own. Read HTML with BeautifulSoup on saved pages, then a polite real scraper at home: robots.txt, rate limits, manners.

    For Riya, about an hour and a half

  3. Automation PackBeing written

    The paperwork behind Riya's prints, done by a program: her price list as an Excel sheet with openpyxl, her portfolio merged into one PDF, and four hundred sketchbook scans renamed in one go. Take It Home.

    For Riya, about 2 hours

  4. SnakeBeing written

    The first game for the Makerspace's arcade cabinet, drawn in Riya's pixel art and her palette. A real-time game loop on a small canvas in the browser: the snake, the food, the walls and the score. Then the Pygame version at home.

    For Riya, about 2 hours

  5. Arcade ShooterBeing written

    A full 2D arcade shooter in Pygame at home, for the cabinet in the Makerspace, with Riya's sprites and Caitlin's rules: classes, collisions, levels, scores and sound. Caitlin insisted on a high-score table.

    For Caitlin, about 5 hours

  6. Flask Web AppBeing written

    A gallery website for Riya's art, with a page for every print and a form for leaving a note on one: routes, templates, forms and SQLite. Take It Home.

    For Riya, about 3 hours

  7. Web App with AccountsBeing written

    Riya's gallery becomes a print shop: user accounts, sessions and properly hashed passwords, so each customer sees only their own orders.

    For Riya, about 3 hours

  8. Deploy ItBeing written

    Caitlin's rule: if nobody else can open it, it isn't shipped. Riya's gallery and print shop online on a free host, with its own address.

    For Caitlin, about an hour and a half

  9. Chat BotBeing written

    A Discord or Telegram bot at home that answers what people always ask Riya about her commissions: prices, sizes, how long a portrait takes, and whether there's room for one more this month.

    For Riya, about 3 hours

  10. Deployed Web AppBeing written

    Act III capstone: your own idea, built, tested, documented and online, with Riya asking who it's for and Paul's review at the end.

    For Paul, about 8 hours

Act 4, floor 3

The Puzzle Room

Algorithms and data structures. About 45 hours, 15 projects.

Neil's floor: a racing simulator rig, a model rocket on the shelf, and a wall of sticky notes and string. Real programs that have to be quick as well as right: a speed tester, a search engine, a sorting visualiser, an undo button, a hash map, a pit-stop scheduler, a maze solver, a route planner for race weekend, a sudoku solver and a spell checker.

  1. Speed Tester

    A speed tester for Neil's spares check on his kart and rocket parts: count the steps at three sizes, chart them, name the growth, time it, and say what the kart track's ten thousand parts will do.

    For Neil, about an hour and a half

    • Big-O, how the steps grow
    • Timing code
  2. Search Engine for a Parts List

    A search engine for Neil's list of kart and rocket parts: whole names by binary search, beginnings with bisect, words anywhere one name at a time, and the looks each one took.

    For Neil, about an hour and a half

    • Linear search
    • Binary search
    • The bisect module
  3. Sorting Visualiser

    A sorting visualiser for the sim league's lap times: selection, insertion, merge and quick sort, each played back frame by frame as bars, then raced against sorted() on ten thousand laps, fastest first.

    For Neil, about 2 hours

    • Selection sort and insertion sort
    • Quicksort
    • Merge sort
    • Stable sorting
  4. Recursive File Tree Printer

    A file tree printer for Neil's old backup, his first lap timer and his first rockets inside: folders inside folders, each one handled the same way, drawn like the tree command, with every folder's size worked out once and written down.

    For Neil, about an hour and a half

    • Recursion
    • Base cases
    • The call stack
    • Memoisation
  5. Undo/Redo Text Editor

    An undo/redo text editor for the code Paul writes on the Workshop chalkboard: a stack of edits to undo, a stack of undos to redo, and a queue of commands run in the order they were typed.

    For Paul, about an hour and a half

    • Stacks
    • Queues
    • collections.deque
  6. Linked List

    A linked list from scratch. The kart track chalked an arrow on every crate of its old kart, each one pointing at the next: build it from two classes, add crates, take them off, and turn the round round.

    For Neil, about 70 minutes

    • Linked lists
  7. Hash Map from Scratch

    Neil's parts script finds any part in a look or two, however many he has. Build a dict from scratch to see how: piles, collisions, doubling, and every probe counted.

    For Neil, about an hour and a half

    • Hashing
    • Hash maps
  8. Parts Catalogue

    A catalogue of Neil's rocket parts kept as a binary search tree, the way he files the cards: add new cards, find any part in a handful of looks, list a section, and copy the tree out three ways.

    For Neil, about an hour and a half

    • Trees
    • Binary search trees
    • Tree traversals
  9. AutocompleteBeing written

    Type three letters of a name in Paul's code editor and see every function and variable that starts that way, most used first: a trie built by hand from the names in the class's code, a letter to a node, with counts at the ends.

    For Paul, about an hour and a half

  10. Task Scheduler

    A pit-stop scheduler for Neil's kart on race day: the most urgent job always next, first come first served on a tie, on a heap built by hand from a list.

    For Neil, about 70 minutes

    • Heaps
    • Priority queues
  11. Maze Solver

    A maze solver for Neil's race weekend: graphs first, on the roads round the circuit, then the car park as a grid, solved breadth first for the fewest steps to his car and depth first for everywhere that can be reached.

    For Neil, about an hour and a half

    • Graphs as dictionaries of neighbours
    • Breadth-first search
    • Depth-first search
  12. Route Planner

    A route planner for Neil's race weekend: Dijkstra round the circuit with minutes on every road, then A* across the car park, heading for his car, with mud at three times the cost.

    For Neil, about 4 hours

    • Weighted graphs
    • Dijkstra's algorithm
    • A* search
  13. Sudoku Solver

    A sudoku solver for Caitlin's puzzle book: fill a square, check it, and back out of every dead end, until the puzzle is solved or shown to be impossible.

    For Caitlin, about an hour and a half

    • Backtracking
  14. Spell Checker

    A spell checker for Paul's end-of-term quiz: the fewest changes between two words, worked out with a table, the nearest real words suggested from a list counted from two old novels, and every answer marked right, near enough or wrong.

    For Paul, about an hour and a half

    • Dynamic programming
  15. Interview Prep SetBeing written

    The Act IV capstone, set by Yahya: twenty timed problems at the level of a first-year computer science course and a junior developer's interview, each with a brief, hidden checks and his time to beat. Paul's whiteboard questions first: pairs that add up, islands on a grid, and merging sorted piles.

    For Yahya, about 10 hours

Act 5, floor 4

The Archive

Data science. About 40 hours, 12 projects.

Yahya's floor: filing cabinets that came with the building, a chart that takes up a whole wall, and a weather station outside the window that has kept a book since 1925. Real data, as real programs: a grade book in NumPy, a cleaning pipeline and pivot tables in pandas, a weather dashboard, a statistics toolkit, a linear algebra lab, the calculus machine learning leans on, and a data story of your own.

  1. NumPy Grade Book

    A grade book for a whole class, in one NumPy array: averages, a curve, z-scores, dropped marks and grade bands, without a loop. On real marks from two schools in Portugal.

    For Yahya, about an hour and a half

    • NumPy arrays
    • Vectorisation
    • Broadcasting
  2. Census Explorer

    A census explorer for Yahya's Archive: ninety years of census returns for the streets round the Clocktower in one pandas table, and the usual questions answered in a line each.

    For Yahya, about 70 minutes

    • pandas DataFrames and Series
    • Selecting and filtering rows
  3. Data Cleaning Pipeline

    Three volunteers typed up the river rescue crew register three different ways. A pandas pipeline cleans it once, in five written-down steps, so nobody has to again.

    For Yahya, about an hour and a half

    • Missing data
    • Cleaning a table
  4. Census Pivot Tables

    Pivot tables of the census for Yahya's wall chart: by parish, by year and by trade, with the Archive's trades index merged in.

    For Yahya, about 70 minutes

    • groupby, aggregation and pivot tables
    • Merging tables
  5. Weather History Dashboard

    A weather history dashboard for the Archive wall: a century of real Met Office readings resampled into years and drawn as four honest charts on one page.

    For Yahya, about an hour and a half

    • Charts with matplotlib
    • Honest charts
  6. Interactive ChartsBeing written

    Caitlin's take on Yahya's dashboard: the same charts made interactive with Plotly. Hover for the exact reading, zoom into a decade, switch a line off from the key, and export the lot as one HTML page anyone can open without Python.

    For Caitlin, about 2 hours

  7. Earth Data MapBeing written

    Real geographic data on a map: Neil's question about where in the world last year's rockets went up from, answered with every orbital launch site plotted by latitude and longitude, sized by its number of launches and coloured by how many reached orbit, over a public coastline, with an honest note on what a map projection does to distances.

    For Neil, about 2 hours

  8. Summary Statistics Report

    A summary statistics report on the Clocktower station's 2024, for the summary sheet in the Archive: the middle day, the usual day, the spread and the readings that don't fit.

    For Yahya, about 70 minutes

    • Mean, median, mode and spread
    • Distributions, quartiles and outliers
  9. Statistics Toolkit

    A statistics toolkit for Yahya's bet that it's warmer outside the Clocktower than it used to be: a permutation test that says how often luck alone could have made the difference, and a correlation that isn't a cause.

    For Yahya, about an hour and a half

    • Probability and simulation
    • Permutation tests and p-values
    • Correlation, and what it doesn't say
  10. Linear Algebra Lab

    A linear algebra lab for Riya in two parts: a month of wind from the Archive's vane as arrows, for her wind print and for Neil's headwind and crosswind on the runway; then a real photograph of a lighthouse as a matrix, mirrored, turned and blurred like her filters, with a rotation matrix to finish.

    For Riya, about 2 hours

    • Vectors and the dot product
    • Matrices and @
  11. Calculus for ML

    Calculus for machine learning, on the hill in the park: slopes measured numerically, the gradient straight uphill, and the chain rule saying which way to turn the dials on the Archive's new thermometer, a model with two settings.

    For Paul, about an hour and a half

    • Derivatives are slopes
    • The chain rule
    • Numerical gradients
  12. Data Story

    The Act V capstone: a data story. A century of the station book cleaned once, summed up honestly, drawn fairly, written up and published as a web page; then a story of your own, from a public dataset of your choice.

    For Yahya, about 10 hours

Act 6, floor 5

The Model Room

Machine learning. About 45 hours, 10 projects.

Paul's floor: whiteboards full of graphs, a coffee machine that never rests, and a laptop training something overnight. Every method is tried on real public data first. House prices, exam scores, diabetes risk, penguins, loans and customers: regression, classification, trees, ensembles, clustering and PCA, built from scratch, then with scikit-learn, and tested for what each model has really learned.

  1. House Price Predictor

    Predict a house's price from its floor area, from 1,000 real sales: the best straight line found by formula, on foot by gradient descent, and by scikit-learn.

    For Paul, about 2 hours

    • Linear regression
    • Mean squared error
    • Gradient descent
    • scikit-learn: make, fit, predict
  2. Exam Score Model

    Predict a student's final maths grade from what's known after the first term: five columns scaled, five weights learnt by gradient descent, then a curve for absences chosen on validation and tested once, honestly, on 357 real students.

    For Paul, about 3 hours

    • Regression with many features
    • Feature scaling
    • Training, validation and test sets
    • Polynomial features
    • Overfitting and underfitting
  3. Spam FilterBeing written

    Paul wants a spam filter he can read line by line, so he knows what it has really learned. Spam or not, for 5,574 real text messages (the SMS Spam Collection, UCI, CC BY 4.0): Naive Bayes from scratch, with word counts per class, log probabilities and smoothing, then precision and recall, because a filter that bins one real message costs more than one that lets a little spam through.

    For Paul, about an hour and a half

  4. Diabetes Risk Classifier

    The chance of diabetes from six survey answers, by logistic regression from scratch on 2,000 real respondents. Then scored honestly, because only one in eight has it: a confusion matrix, precision and recall, an ROC curve, and a screening threshold.

    For Paul, about 3 hours

    • Logistic regression
    • Cross-entropy (log loss)
    • Precision, recall and the confusion matrix
    • ROC curves and AUC
  5. Iris and Penguins Classifier

    Name a penguin's species from its measurements, and an iris's with the same code, the way people are thought to name things: by the remembered examples most like it. k nearest neighbours from scratch, with k chosen on validation and tested once.

    For Aaesha, about an hour and a half

    • k nearest neighbours
  6. Loan Approval Tree

    Approve or decline a loan from seven answers on the form, for 1,000 real applicants: a decision tree grown from scratch and read as questions, then a random forest from scratch and gradient boosting, judged by what their mistakes cost.

    For Paul, about 3 hours

    • Decision trees
    • Ensembles: forests and boosting
  7. Movie RecommenderBeing written

    For the class film night, Caitlin wants something better than a vote, and more fun than an argument. What to watch next, from what people like you rated: collaborative filtering by user and by film similarity, then a matrix factorisation learnt by gradient descent. MovieLens's terms forbid passing the data on, so this needs GroupLens's permission, a Take It Home download of MovieLens, or another openly licensed set of ratings.

    For Caitlin, about 2 hours

  8. Customer Segmentation

    Sort a wholesaler's 440 real customers into segments by what they buy, with k-means from scratch and k at the elbow, then find the two directions they differ along most with PCA from scratch, and check both against what the clusters never saw.

    For Yahya, about 2 hours

    • k-means clustering
    • Principal component analysis
    • Eigenvectors and eigenvalues
  9. Model Evaluation Clinic

    Before a model gives away anyone's place at Neil's stargazing nights, a clinic: the column that knows the answer, preprocessing kept inside the folds, four models compared by cross-validation and a grid search, one look in the bottom drawer, and who the model is wrong about.

    For Neil, about 2 hours

    • Pipelines: steps that travel together
    • Cross-validation
    • Grid search
    • Data leakage
    • Model bias across groups
  10. Fishing Forecast

    The Act VI capstone, an end-to-end machine learning project. Good fishing or not, from what's known at dawn: three years of the fleet's log, features a skipper would recognise, a model chosen by cross-validation, one honest look at the last year, and a write-up of what worked and what didn't.

    For Paul, about 10 hours

    • Baselines
    • Feature engineering

Act 7, floor 6

The Engine Room

Deep learning and AI. About 60 hours, 14 projects.

Aaesha's floor, behind the clock's gears: a rack of servers, and a model of a brain on the shelf. How networks perceive, remember and attend, and where they're nothing like a mind. A neural network from scratch, an autograd engine, a digit recogniser, PyTorch, an image classifier, a tide predictor, a text generator and a tiny GPT, built up from the chain rule and checked at every step.

  1. Neural Network from Scratch

    A two-layer network in NumPy that learns how Paul makes three calls every evening: one neuron and its limits, the forward pass, backpropagation on paper and in code, every gradient checked by measurement, then trained and tested on evenings it never saw.

    For Aaesha, about 3 hours

    • The perceptron
    • Layers and the forward pass
    • Activation functions
    • Backpropagation
    • Checking gradients by measuring
  2. Tiny Autograd Engine

    A micrograd-style autograd engine: numbers that remember how they were made, so one backward() shares out the blame for a mistake, the puzzle every learning brain has to solve. Drawn as a graph, then a neuron that trains on it.

    For Aaesha, about 2 hours

    • Autograd
  3. Optimiser Benchmark

    A time trial for optimisers. One network, one start, one log of 800 evenings, and three optimisers written from scratch: plain SGD, momentum and Adam, compared fairly, then Adam again from all zeros.

    For Neil, about an hour and a half

    • Optimisers, mini-batches and the learning rate
    • Starting weights
  4. Handwritten Digit Recogniser

    Perception, from sixty-four greys: a NumPy network learns to read 1,797 real handwritten digits, 8 by 8 greys, with softmax, cross-entropy, mini-batches and Adam, and a test on 297 digits it has never seen.

    For Aaesha, about 2 hours

    • Softmax and cross-entropy
  5. PyTorch Fundamentals

    Take It Home: the digit recogniser rebuilt in PyTorch on your own computer, with tensors, autograd, nn.Module and a training loop, checked by a real pytest suite.

    For Paul, about 2 hours

    • PyTorch
  6. Image Classifier

    A convolutional network's forward pass by hand in NumPy, seeing the way the visual cortex starts to: edges on the Clocktower, pooling, and four trained filters that classify handwritten digits from thirty-six numbers each.

    For Aaesha, about 2 hours

    • Convolutions and pooling
  7. Seeing Forecaster

    A network that forecasts the seeing for Neil's stargazing nights from the weather, taught not to memorise: Riya's fits 24 nights perfectly and the rest badly, until weight decay, dropout, early stopping and batch norm teach it to hold back.

    For Neil, about an hour and a half

    • Regularisation: weight decay and early stopping
    • Dropout
    • Batch normalisation
  8. Tide Predictor

    A tide forecast from a network with a memory: it reads the river gauge an hour at a time, remembers the hours before, guesses the next, and beats the same-as-last-hour forecast. Then a gate on its memory.

    For Aaesha, about 2 hours

    • Recurrent networks
    • LSTM gates
  9. Text Generator

    A character-level text generator that writes shipping forecasts: a vocabulary, a model that counts which character follows which, and the same model learnt by gradient descent through embeddings.

    For Caitlin, about an hour and a half

    • Tokens, vocabularies and ids
    • One-hot rows and embeddings
    • Language models and perplexity
  10. Sentiment AnalyserBeing written

    Yahya wants the story in the words, not just the star rating: what reviewers really think. For or against: 3,000 labelled sentences from film, product and restaurant reviews (Sentiment Labelled Sentences, UCI, CC BY 4.0). Tokenise them, learn word embeddings, and read each sentence with an LSTM, with a NumPy forward pass in the browser and training in PyTorch at home.

    For Yahya, about 3 hours

  11. Tiny GPT

    A character-level GPT from scratch, where attention means what it says: self-attention with a causal mask, several heads, a transformer block checked number by number, then two trained blocks that write in the style of Three Men in a Boat.

    For Aaesha, about 4 hours

    • Scaled dot-product attention
    • Transformer blocks
  12. Using Pretrained ModelsBeing written

    Aaesha wants to know what a model brings to a task from everything it read before, and when that beats one you built yourself. Take It Home with Hugging Face: a pretrained sentiment model run through a pipeline, scored against the Sentiment Analyser on the same sentences, then a small model fine-tuned on them.

    For Aaesha, about 2 hours

  13. AI AppBeing written

    Take It Home, for Caitlin: a small app built on a large language model API that suggests what to cook from whatever is in the cupboard. A prompt kept in a file, a test set of questions with the answers they should get, an evaluation that scores every change, and a limit on what it may spend.

    For Caitlin, about 3 hours

  14. Notebook Reader

    The Act VII capstone, a deep learning project from start to finish: a small network learns Paul's notes four characters at a time, beats the bigram on notes it never saw, and finishes a note when you start one. It learns how he sounds, not what he means. With a write-up.

    For Aaesha, about 10 hours

Act 8, floor 7

The Arcade

Reinforcement learning. About 50 hours, 12 projects.

Aaesha and Caitlin's floor: a row of cabinets, a leaderboard, a prize shelf and a racing crab that knows nothing yet. Caitlin brings the games; Aaesha wants to know how anything learns to decide. Bandits, Markov decision processes, dynamic programming, Monte Carlo and TD learning, Q-learning, DQN, policy gradients, actor-critic and PPO, all the way to the weekly Arcade League.

  1. A/B Test Bandit

    Four attract screens for Caitlin's new cabinet, five thousand visitors walking past, and a test that shows the winner more often as it learns: epsilon-greedy, UCB and Thompson sampling.

    For Caitlin, about 2 hours

    • Multi-armed bandits
    • Exploring and exploiting
    • A/B tests and what they cost
  2. Gridworld Simulator

    Neil's search for a better racing line on the crab cabinet's grid, as a Markov decision process: tiles, moves, slips, rewards, policies and what a race is worth.

    For Neil, about an hour and a half

    • Markov decision processes
    • Returns and discounting
  3. Gridworld Solver

    For Aaesha, planning the way a mind with a map does: the worth of every tile on the crab's racing grid, without a single race. Policy evaluation, value iteration and policy iteration.

    For Aaesha, about an hour and a half

    • Policy evaluation
    • Value iteration
    • Policy iteration
  4. Value Estimator

    The worth of every tile, learned from races alone with no map, the way animals learn from surprise: Monte Carlo and temporal difference learning.

    For Aaesha, about an hour and a half

    • Monte Carlo learning
    • Temporal difference learning
  5. Tic-Tac-Toe AgentBeing written

    An opponent for Caitlin's noughts and crosses cabinet that learns by playing itself: Monte Carlo control from whole games, then self-play until it never loses, even to Yahya.

    For Caitlin, about 2 hours

  6. Q-Learning Crab

    Caitlin's crab learns the League course by racing it, with Q-learning, and goes into the Arcade League. SARSA walks a clifftop.

    For Caitlin, about an hour and a half

    • Q-learning
    • SARSA
  7. Snake AIBeing written

    For Aaesha, who wants to know what a player really needs to notice: Q-learning plays Snake, with a state of eleven facts small enough for a table, rewards that teach the right thing, and a snake that beats its first thousand games.

    For Aaesha, about 3 hours

  8. Tide Gate Controller

    Caitlin's Tide Gate game as a Gymnasium environment, kept by a keeper that learned it: a harbour balanced between the mud and the quay, at home.

    For Caitlin, about 2 hours

    • Gymnasium environments
  9. CartPole with DQN

    Q-values from a small network instead of a table, kept steady by a replay buffer and a frozen target network: built on the racing grid, then taken home to balance Gymnasium's CartPole, which Neil calls a rocket landing in miniature.

    For Neil, about 4 hours

    • Deep Q networks
  10. Policy Gradients

    The law of effect, in code: REINFORCE on the racing grid, a softmax policy nudged towards whatever went well, and a baseline that steadies every nudge.

    For Aaesha, about 2 hours

    • Policy gradients and REINFORCE
  11. Actor-Critic and PPO

    One part acts and one part judges, as one theory of the brain has it: one-step actor-critic on the racing grid, with the critic's TD error as each move's verdict, and PPO's clipped objective read and worked by hand.

    For Aaesha, about 2 hours

    • Actor-critic and PPO's clip
  12. Arcade League

    The capstone: a crab that learns whatever course Caitlin's generator lays out, on a budget of practice, judged on courses nobody has seen, and entered in the weekly Arcade League.

    For Caitlin, about 10 hours

Act 9, the roof

The Roof Terrace

Capstones and portfolio. About 60 hours, 9 projects.

Everyone's floor: the clock face, the city at night and a string of lights. Two capstones from a short list, each brought by someone in the class, or one of your own: Caitlin's marina bookings, Yahya's weather investigation, Paul's paper reproduction, Caitlin's arcade game. Then Riya's portfolio, Yahya's timed paper and practice interviews, the radio, and the clock.

  1. Berth Booking Web App

    Caitlin's first real client: visitor berth bookings for a marina on the river, as a Flask web app on your own computer, with agreed routes, your own tests, and a handover the marina can run.

    For Caitlin, about 20 hours

  2. Weather Data Investigation

    Yahya's challenge: one question put to 150 years of real Met Office readings from Stornoway, and answered honestly. Loaded, checked, charted and written up.

    For Yahya, about 20 hours

    • Where the numbers came from
  3. Paper Reproduction

    Paul's question about what big models really learn: double descent, from a 2019 paper, reproduced in NumPy at a size that runs in seconds. The pieces, the curve, one experiment of your own, and an honest account of what didn't match.

    For Paul, about 20 hours

    • Double descent
    • Reproducible results
  4. Arcade Catch Game

    Mackerel Night, a Pygame game for a new cabinet in the Arcade: rules you can test without a window, drawing kept apart, played by real people and handed to Caitlin.

    For Caitlin, about 20 hours

    • The game loop
  5. Your Own Project

    A project of your own choosing, in your own interest, for someone real: proposed, built a slice at a time with tests, and handed over with Paul's review.

    For Paul, about 25 hours

    • Testing the tests
  6. Portfolio BuilderBeing written

    For Riya, who knows a portfolio is a gallery wall with the best work at eye level: a program that turns every project on your Shelf into a GitHub profile README and a public portfolio page, the best chosen, written up honestly, and published.

    For Riya, about 3 hours

  7. University and Interview Readiness

    Yahya's timed paper of six first-year problems, from the Workshop to the Puzzle Room, then practice at explaining your own work out loud, as a university interview or a job interview would ask.

    For Yahya, about 3 hours

    • Binary search on the answer
  8. Radio Station Finder

    Caitlin wants music on the roof for the last night of term, and the old Studio radio hisses from one end of the dial to the other. Smooth the dial, find the real stations, and turn it up.

    For Caitlin, about 60 minutes

  9. Acceptance Test Suite

    On the roof, by the clock face, the clock's controller gets its first tests. Then the clock runs.

    For Paul, about an hour and a half