Miguel A. Bessa | miguel_bessa@brown.edu | Associate Professor
What: This course aims to be an introduction to machine learning from a probabilistic perspective.
Where: This notebook comes from this repository
Reference: Murphy, Kevin P. Probabilistic machine learning: an introduction. MIT press, 2022. Available online here
Field guide: FIELD_GUIDE.md collects the key concepts and good practices of the course, organized by the stages of a data-driven project, with the lectures where each one is taught. It grows with the course: use it for the final project, and keep it for later.
How: We try to follow Murphy's book closely, but the sequence of Chapters and Sections is different. The intention is to use notebooks as an introduction to the topic and Murphy's book as a resource.
- If working offline: Go through this notebook and read the book.
- If attending class in person: listen to me (!) but also go through the notebook in your laptop at the same time. Read the book.
- If attending lectures remotely: listen to me (!) via Zoom and (ideally) use two screens where you have the notebook open in 1 screen and you see the lectures on the other. Read the book.
Folder structure
- The "Lectures" folder contains each lecture in a separate folder "LectureX" where X is the lecture number.
- Each "LectureX" folder contains:
- A jupyter notebook "3dasm_LectureX.ipynb" that you can run locally or in servers like Google Colab.
- A "your_data" folder that you can use to create data or other things in your own computer.
- The
Lectures/dataandLectures/figuresfolders hold datasets and figures shared by several lectures.
- The preferred method to follow the course is to look directly into the jupyter notebook, as it contains additional notes and working code.
Note
Prefer to write the code yourself? From Fall 2026, some practical lectures are taught with an AI coding agent.
The version of the course in which every practical lecture is coded by hand, including all corrections up to
September 2026, is kept at the tag v2026-non-agentic.
The 2025 course is at v2025-pre-agentic.
Grading
The syllabus is the official course document; office hours and classroom are listed on the Canvas course page and on Courses@Brown.
Homeworks 10%, Midterm 40%, and Final Project 50%.
Homeworks will be graded only with 5 levels: A+ (100%; fully correct), A (90%; has minor error), B (75%; has significant error or several minor errors), C (60%; several significant errors), D (0%, homework not delivered). If you deliver something with an honest attempt at solving the homework you get 60% for that homework.
Note
Late Homework can only get up to A (90%).
The worst Homework is removed from the final grade.
Using LLMs and AI coding agents in this course
You are encouraged to use large language models (ChatGPT, Claude, Gemini, open-weight models, etc.) and AI coding agents (Claude Code, opencode, Copilot, etc.) throughout this course, including for homework. However, be aware that using an LLM to do your homework can significantly impair your learning: two large controlled studies found that students with AI help scored much better on homework and then scored worse than students without AI on the exams that followed.
- Bastani et al. (2025), a randomized trial with about 1,000 high-school students: GPT-4 access raised practice performance by 48%, and those students then scored 17% lower than the control group on the exam. PNAS 122(26)
- Strömberg, Lei & Wu (2026), 30 months of data on 26,811 secondary-school students: AI use raised homework scores by 18%; unaided exam scores fell by 20% within six months. 81% of AI users used it to generate answers; only those students were harmed. CEPR Discussion Paper 21577
This is why:
- Homeworks only weigh 10% of the grade because good LLMs can solve them.
- The midterm is closed-book (no computer, no Internet, and... no LLM).
- The Final Project has an open-ended component. Working with an LLM is encouraged. The question is: how great can that project become?
The lecture and homework notebooks run Claude Code, Anthropic's coding agent, with the Sonnet or Haiku models. How to install it, and two short free courses that teach how to use it, are in the installation instructions below (step 8).
Course outline
| DATE | SUBJECT | Notebook | Reading | Homework | Colab |
|---|---|---|---|---|---|
| Wed 9/9 | Introduction: Basics of univariate statistics | Lecture 1 | Chapter 2 until Section 2.3 | HW1 assigned | |
| Fri 9/11 | Practical tutorial: Handling data with Pandas | Lecture 2 | |||
| Mon 9/14 | Bayes' rule: joint & conditional distributions | Lecture 3 | Chapter 3 (until Section 3.3) | ||
| Wed 9/16 | Multivariate statistics: visualization of joint & conditional distributions | Lecture 4 | Bishop's book Section 2.3 | HW1 due & HW2 assigned |
|
| Fri 9/18 | Bayesian inference for one hidden rv: Example with Gaussian likelihood and Uniform prior (Part I) | Lecture 5 | Chapter 3 | ||
| Mon 9/21 | Bayesian inference for one hidden rv: Example with Gaussian likelihood and Uniform prior (Part II) | Lecture 6 | Chapter 3 | ||
| Wed 9/23 | Bayesian inference for one hidden rv: Redo example but now with Gaussian prior | Lecture 7 | HW2 due & HW3 assigned |
||
| Fri 9/25 | Machine Learning without going Bayesian: Point Estimates | Lecture 8 | Chapter 4 | ||
| Mon 9/28 | Linear Regression: Linear Least Squares model (Gaussian likelihood, Uniform prior, and Point Estimate) | Lecture 9 | Chapter 11 | ||
| Wed 9/30 | Linear Regression in practice, with an AI coding agent (Part I: the car stopping distance problem; instructions file; train/test split; MSE and R2) | Lecture 10 | Chapter 11 | HW3 due & HW4 assigned |
|
| Fri 10/2 | Linear Regression in practice, with an AI coding agent (Part II: rescaling the inputs; interpolation vs. extrapolation; cross-validation; noisy data: underfitting vs. overfitting) | Lecture 11 | Chapter 11 | ||
| Mon 10/5 | Linear Regression: more than one input (the curse of dimensionality); Ridge and Lasso regression (different priors on the weights) | Lecture 12 | Chapter 11 | ||
| Wed 10/7 | Bayesian linear regression: aleatoric and epistemic uncertainty, and heteroscedastic noise | Lecture 13 | Sections 11.7 and 2.6.3 | HW4 due & HW5 assigned |
|
| Fri 10/9 | Gaussian process regression: theory (from Bayesian linear regression to kernels) | Lecture 14 | Section 17.2 + Rasmussen's book | ||
| Mon 10/12 | HOLIDAY 🥹 | ||||
| Wed 10/14 | Gaussian process regression in practice, with an AI coding agent: hyperparameters, kernels and noise | Lecture 15 | Section 17.2 + Rasmussen's book | HW5 due & HW6 assigned |
|
| Fri 10/16 | Gaussian process regression: more than one input, scaling the data, and the cost of Gaussian processes | Lecture 16 | Section 17.2 + Rasmussen's book | ||
| Mon 10/19 | Bayesian model selection & Hyperparameter optimization | Lecture 17 | Sections 4.6.5 and 17.2.6 + Rasmussen's book Sections 5.2, 5.3 and 5.4 | ||
| Wed 10/21 | Q&A session | HW6 due |
|||
| Fri 10/23 | MIDTERM Exam 🦾 |
||||
| Mon 10/26 | Solution and discussion of the midterm | ||||
| Wed 10/28 | Framework for Data-Driven Design & Analysis of Structures & Materials: f3dasm | Lecture 18 | |||
| Fri 10/30 | adda: an AI agent runs the data-driven process; our own tool, which holds the experiment and its budget; checking the agent | Lecture 19 | |||
| Mon 11/2 | adda: a team of agents; the statement as a table of decisions; checks and reproducibility | Lecture 20 | |||
| Wed 11/4 | Final Project Overview & Assignment 🦾 |
Lecture 21 | HW7 assigned & Final Project assigned | ||
| Fri 11/6 | Introduction to classification: Tutorial with 3 simple classifiers on Iris dataset | Lecture 22 | Sections 1.2.1 + 2.4.2 + 10.1 + 10.2 | ||
| Mon 11/9 | Logistic regression classifier: Classification as a regression task; Bernoulli observation distribution; the sigmoid trick | Lecture 23 | Sections 1.2.1 + 2.4.2 + 10.1 + 10.2 | ||
| Wed 11/11 | Logistic regression classifier: Point estimate (e.g. MLE) as nonlinear optimization; classification as the mode of PPD | Lecture 24 | Sections 10.2 + 2.5 + 10.3 | HW7 due & HW8 assigned |
|
| Fri 11/13 | Gaussian discriminant analysis (GDA) classifier: Classification by a generative model | Lecture 25 | Chapter 9 | ||
| Mon 11/16 | Optimization: Part I | Lecture 26 | Martins' book Chapters 1 & 7 | ||
| Wed 11/18 | Optimization: Part II | Lecture 27 | Martins' book Chapter 4; Murphy Chapter 8 | HW8 due |
|
| Fri 11/20 | Automatic differentiation: the chain rule on a graph; forward and reverse mode; backpropagation | Lecture 28 | Section 13.3 | HW9 assigned | |
| Mon 11/23 | Neural networks (Part I): learned basis functions, activations, ridges and decision boundaries, what depth buys | Lecture 29 | Chapter 13 | ||
| Wed 11/25 | Thanksgiving 🦃 | ||||
| Fri 11/27 | Thanksgiving 🦃 | ||||
| Mon 11/30 | Neural networks (Part II): the Bayesian view, a prior on functions, non-convexity; training and hyperparameters | Lecture 30 | Chapter 13 | ||
| Wed 12/2 | Neural networks (Part III): deep networks and vanishing gradients; uncertainty with ensembles; networks or Gaussian processes? | Lecture 31 | Chapter 13 | HW9 due |
|
| Fri 12/4 | Artificial Neural Networks: Part IV | Lecture 32 | |||
| Mon 12/7 | Principal Component Analysis | Lecture 33 | Section 20.1 | ||
| Wed 12/9 | Clustering | Lecture 34 | Chapter 21 | ||
| Fri 12/11 | Resit midterm exam (optional) |
Final Project report due |
Homework 1 contains detailed instructions to install the virtual environment with all the packages required for this course. Below are more concise instructions for people familiar with mamba and pip:
-
Install Mamba as described here. (See Homework 1 for additional instructions)
-
Install git, open command window & clone the repository to your computer:
git clone https://github.com/bessagroup/3dasm_course
- Create a virtual environment for this course called '3dasm':
mamba create -n 3dasm -c conda-forge python=3.12 "jupyterlab>=4.1,<5" ipykernel "ipywidgets>=8.1" ipympl jupyterlab-mathjax3 numpy scipy matplotlib pandas scikit-learn requests "optuna>=4.4"
- Activate the '3dasm' virtual environment:
mamba activate 3dasm
- Install pytorch in the '3dasm' virtual environment. (See Homework 1 for additional instructions)
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126
- Install f3dasm package:
pip install "f3dasm[scipy]==2.4.0"
- Install the RISE extension, which turns these notebooks into slides:
pip install jupyterlab-rise==0.43.1
-
Install Claude Code, the AI coding agent used by the lecture and homework notebooks (from Lecture 10 on). In a terminal, run:
- macOS, Linux or WSL:
curl -fsSL https://claude.ai/install.sh | bash - Windows PowerShell:
irm https://claude.ai/install.ps1 | iex
Then open a new terminal and check that
claude --versionprints a version number. Runclaudeonce and log in with your Claude account (the course seat invited on your brown.edu address, or your own Pro or Max plan: the free plan does not include Claude Code). Anthropic's installation page has the other options (Homebrew, WinGet) and a troubleshooting guide.Start JupyterLab from a terminal where
claude --versionworks: the notebooks callclaudeto run their agents.If you have not used Claude before, two short free courses from Anthropic cover what you need, and both issue a certificate. They are optional, but strongly recommended:
- Claude 101 (about 1 hour): the web and desktop apps, projects, and how to get good results.
- Claude Code 101 (2 to 3 hours): installing and using Claude Code in the terminal, and the explore → plan → code → commit workflow that we follow for coding assignments.
- macOS, Linux or WSL:
After you installed every package, you are ready to go! Reboot your computer.
- Open a (mamba) command window, activate the '3dasm' environment and start JupyterLab (it will open in your internet browser):
mamba activate 3dasm
jupyter lab
- Open notebook (for example: 3dasm_course/Lectures/Lecture01/3dasm_Lecture1.ipynb).
You're all set!
Colab cannot run the AI coding agents of the notebooks (from Lecture 10 on): there, you can read the recorded outputs, but to run a prompt yourself you need Option 1.
- go to Google Colab
- Login with your credentials
- File > Open notebook
- Click on Github (no need to login or authorize anything)
- paste the git link: https://github.com/bessagroup/3dasm_course
- click search and then click on the notebook (for example: 3dasm_course/Lectures/Lecture01/3dasm_Lecture1.ipynb)