Lab Notebooks

The labs are Jupyter notebooks, one per session. Every one runs offline on a laptop CPU with fixed seeds — no GPU, no API key, no paid service. Clone the course repository once and git pull before each session; the labs read helpers and data from the folders beside them, so a notebook downloaded on its own will not run. Session 1's last deck, The Workbench, walks through every step below.

▶  Open in GitHub Codespaces Browse the repository

Option 1 — run in the cloud (Codespaces)

Quota. Any GitHub account can launch a codespace on this repository, and it runs on your own free monthly allowance (120 core-hours + 15 GB storage on a personal account) — nobody else is billed for your session. Stop idle codespaces and the free tier comfortably covers the whole course.

Option 2 — run locally

Install Python 3.11, git and VS Code, then, in a terminal:

git clone https://github.com/vonzhg/AI-ECON-2026.git
cd AI-ECON-2026
python3 -m venv .venv                # Windows: py -3.11 -m venv .venv
source .venv/bin/activate            # Windows: .venv\Scripts\Activate.ps1
python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple \
    numpy pandas matplotlib scipy scikit-learn torch jupyter ipykernel

Then open the folder in VS Code, select the .venv kernel for the notebook, and run its first cells: they print every package's version and say READY or what is missing. On Windows and macOS the standard PyTorch install is already the CPU build.

Installing from China. The install line above already uses the Tsinghua (TUNA) mirror, which is usually much faster than the default index. No Google or Colab access is needed for any lab.

Session labs

One notebook per session, posted to the repository before the session meets; the syllabus says what each one asks.

Session 1 — Orientation: Two Machines, One Environment Released before the session
Session 2 — Deep learning: From One Neuron to a Solved Growth Model Released before the session
Session 3 — Reinforcement learning: One Growth Model, Every Reinforcement-Learning Method Released before the session
Session 4 — Heterogeneous agents: Distributions as State, Solved Two Ways Released before the session
Session 5 — Text and LLMs: Words as Data, and What a Language Model Measures Released before the session
Session 6 — RAG and agents: An Agent You Can Audit, and the Retrieval It Reads From Released before the session

Notebooks from the Summer 2026 version

The labs of the ten-lecture version taught at Zhejiang University in Summer 2026 stay available; the Summer 2026 page keeps the decks they went with.

Lectures 1–2 — Getting Started Available View on GitHub ▶ Run in Codespaces
Lecture 3 — Machine Learning Basics Available View on GitHub ▶ Run in Codespaces
Lecture 4 — Deep Learning for Dynamic Models Available Lab 4A — VFI benchmark Lab 4B — neural nets ▶ Run in Codespaces
Lecture 5 — Reinforcement Learning in a Nutshell Available Lab 5A — View on GitHub ▶ Run in Codespaces
Lecture 7 — LLMs & Text as Economic Data Available Lab 7A — text as data Lab 7B — attention & mini-GPT ▶ Run in Codespaces
Lecture 8 — Retrieval-Augmented Generation Available RAG lab — speech corpus Part B — mini-GPT + RAG ▶ Run in Codespaces
Lecture 9 — Anatomy of an Agent & the Design Lab Available Part A — the loop, offline Part B — real agents Agent design canvas Design Lab scenarios ▶ Run in Codespaces
Finished the labs and want to build something of your own? The project tracks take you from a lab exercise to a small, validated piece of research.