You will build the course's digits network one piece at a time, from a single neuron to its ten scores, turn the scores into chances and a loss by hand, and check its loss before it learns against a fair guess of 2.30.

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 digitsRun it
  2. One neuron, by handYour turn
  3. The network, and its first errorYour turn
  4. Two layers with no bend are oneYour turn
  5. Softmax and the loss, by handYour turn
  6. The loss at the start, and softmax twiceYour turn
  7. A digit reader for bigger picturesOn your own
Terminal
curl -LsSf https://astral.sh/uv/install.sh | sh
cd learn-deep-learning/labs/dl-lab-digit-reader/starter
uv sync

See it on GitHub

When you have run it

After step 7, how many weights does your network for pictures of 28 by 28 have?

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 .