Deep Learning · Deep Learning
Tiny Vision Application
In Deep Learning because tiny image/pattern nets practice the neural training loop on spatial inputs.
Vision labs stay on synthetic grids in the browser.
- Deep Learning
- Medium level
- 3 concepts
1Defect / digit style tasks
Factories score tiny image patches for defects; here we use synthetic patterns.
Never pull ImageNet into the browser runtime.
Figure. Factories score tiny image patches for defects; this lesson uses synthetic patterns. Never pull ImageNet into the browser runtime — a real corpus would neither fit in the tab nor finish there.
Why does this lesson work on synthetic patterns rather than a real image dataset?
- The runtime is a browser tab, and a real image corpus would neither fit in it nor finish there
- Synthetic patterns are harder, so they teach more
- Real images need a convolutional layer, which torch does not provide
- Labelled image data is not publicly available
The constraint is the runtime, not the pedagogy. Synthetic grids let the loop, the shapes and the metric be practised honestly at a size the tab can carry.
2Flatten then classify
For 8×8 patterns a small dense net is enough to practice the loop.
True CNNs shine when local structure matters and data grows.
Figure. For 8×8 patterns a small dense net is enough. Flatten the patch to a 64-length vector, scale pixels to roughly [0,1], then two hidden layers and a softmax — argmax is the predicted label. True CNNs wait until local structure matters and data grows.
- Flatten the patchReshape 8×8 pixels into one 64-length vector — order must match every row in the batch.
- Normalise inputsScale pixel values to roughly [0,1] so activations stay in a trainable range.
- Dense layers to logitsTwo hidden layers then a softmax over class count — argmax gives the predicted label.
A dense net copes with 8x8 patterns and is hopeless on 256x256 photographs. Which pressure grows fastest?
- The number of training epochs required to converge
- The number of output classes to be distinguished
- The depth needed, which grows with the width of the image
- The parameter count, because a dense layer needs one weight for every pixel and every unit
Pixels grow with the square of the side, and a dense layer multiplies that by its unit count. The weight matrix outruns both the data and the memory long before anything else does.
3Lab: tiny pattern net
Train a small torch MLP on synthetic 16-d patterns and print score loss.
Figure. The lab draws synthetic 16-d patterns — 160 rows — runs a torch MLP 16→16→1, and prints an MSE score. No optimizer is called, so the number is the untrained baseline, not a trained result.
Coding lab. Tiny vision MLP runs in the app, with checks on your output.
The tiny-vision lab runs a forward pass and prints a loss without ever calling an optimizer. What does that number describe?
- The error of an untrained network — a starting point rather than a result
- The model's accuracy once training has finished
- The best loss that is reachable on this data
- The loss after one epoch of automatic training
No optimizer step means no parameter ever moved from its random initialisation. The figure is the baseline that training would have to improve on, and reading it as a result is the trap.
Notes
- Classify tiny synthetic digit-like patterns with a small net.
- Factories score tiny image patches for defects; here we use synthetic patterns.
- For 8×8 patterns a small dense net is enough to practice the loop.
Exam traps & shortcuts
- Keep lab datasets under 2000 rows in the browser runtime.
- Split train and test before fitting any model that sees labels.
Recap
This lesson in brief:
- Defect / digit style tasks
- Factories score tiny image patches for defects; here we use synthetic patterns.
- Flatten then classify
- For 8×8 patterns a small dense net is enough to practice the loop.
- Lab: tiny pattern net
- Train a small torch MLP on synthetic 16-d patterns and print score loss.
Practise Tiny Vision Application
Reading is free and needs no account. Practice, mocks and progress live in the app.
- A 1-question practice set that ends the chapter
- 3 quick checks with worked explanations
- Timed mocks scored with the real marking scheme
- Readiness tracked per topic, kept on your device