You will train an MLP and a small CNN on the digits, move every picture one pixel to the right and see which still reads it, then look inside each one's hidden layer for what it keeps of a moved digit.

About 40 minutes. You do it on your own computer. You need your own computer, with uv (free); Windows, Linux or a Mac with Apple silicon, since PyTorch no longer ships for Intel Macs; about 1 GB of disk for PyTorch.

  1. The MLPRun it
  2. The CNN, and its shape errorYour turn
  3. Move every digitYour turn
  4. The nearest picturesYour turn
  5. What each hidden layer keepsYour turn
  6. Scrambled pixelsOn your own
Terminal
curl -LsSf https://astral.sh/uv/install.sh | sh
cd learn-deep-learning/labs/dl-lab-moved-digit/starter
uv sync

See it on GitHub

When you have run it

In step 3, what share of the 360 does the MLP get right when every picture is moved one pixel to the right, in percent?

%

Run on macOS on an M1 Max, uv 0.11.15, Python 3.12, PyTorch 2.15.0, NumPy 2.5.5, scikit-learn 1.9.1. Checked on .