borch

Capstones · 3

Watch a network learn a boundary

A classifier's whole job is to carve the input space into regions, one per class. For points on a plane you can see that carving: colour every point by the class the network would give it, and the split between the colours is the decision boundary. A linear model can only draw a straight line; a network with a hidden layer can bend it. Here a small MLP separates two interleaving moons — the boundary is drawn before training (random) and after (bent to fit).

The boundary, before and after

Two half-moons, each a class, that no straight line can separate. The grid below reads the network's decision at every point on the plane and draws it as a heatmap: the two shades are the two classes, and the seam between them is the boundary. Press Run — the first heatmap is the untrained net's random split, the second is what 140 steps of training bent it into, and the curve is the loss coming down.

What to remember

If a block above errors, that is worth knowing. Every example on this page runs against the same library the tests run against — nothing here is a screenshot. Press Reset to get the original code back.