Homework — rates, data size, the report
Two experiments and one report line. Both experiments are just train with different arguments, no new code is needed.
1. Two learning rates that are not in the table
The table in step 7 had 0.0001, 0.01, 0.05, 0.1, 0.2, 0.5, 1.0. Run train with lr = 0.03 and lr = 0.3 (300 steps) and fill in the rows:
lr |
final loss | training accuracy | test accuracy |
|---|---|---|---|
| 0.03 | |||
| 0.3 |
Say in one sentence: do they fall inside the "wide good interval" of step 7? Does the loss tell you the same as the accuracy?
2. More data or more steps?
Run train(x[:n], y[:n], steps=300, lr=0.1) with n = 100, n = 1,000 and n = 10,000. For each — the training and the test accuracy.
You should see this pattern (your numbers may differ by a point or two):
n |
training | test | gap |
|---|---|---|---|
| 100 | 100.0 % | 68.9 % | 31.1 |
| 1,000 | 87.6 % | 78.5 % | 9.1 |
| 10,000 | 81.7 % | 80.0 % | 1.7 |
Answer:
- Why does the training accuracy fall as data grows? (Hint: 7,850 numbers that have to "remember"
npictures.) - Which column matters to you when building a classifier?
- When
n = 100, the model "remembers" all 100 pictures and gets a third of new ones wrong. What is this phenomenon called? (We will look at it in depth later; for now it is enough to notice it.)
3. Your report line
In your course report (started in lesson 3) write two lines next to the "baseline":
lesson model baseline training test
3 10 neurons, untrained 10 % 10.2 % —
4 10 neurons, 300 steps, lr = 0.1 10 % 81.7 % 80.0 %
And one more sentence: which of the two numbers (training or test) is the "real" one? Why?
What to hand in
Two tables and your sentences. And train_scratch.py — do not change it later: it stays as the "before picture" against which everything that follows will be compared.
Tip. Today you wrote by hand what every training framework does for you: loss, gradients, update, clean-up. From the next lesson you will have tools that package that loop. You learned it while it hurt — and now you will know what they do.