Back to demos

Learned gallery

Unfreeze a compiled program’s weights & train them in real time.

Try
Sketch
Choose preset
Learned
Loss + after steps
More detail

What’s happening

A tiny neural net places the photos. It has adjustable numbers, called weights, and every photo’s position and size is computed from them. When you edit the sketch, the page nudges the weights about times a second until the photos land where you drew them. That’s training, and it runs live in this tab.

The loss

Training needs a score to shrink, called the loss. The chart draws its two parts: how far the photos are from the sketch, in copper, and how much edges that nearly line up miss each other, in indigo. Every step changes the weights a little so that the score drops. Pairs of edges that stay apart get pulled harder over time, so they end exactly on one line.

The slider

The misalignment penalty sets how tidy the result is. At 4%, two edges of one kind, e.g. two tops, that are closer than 2% of the stage’s width end on one line, even when the sketch is a bit off. Slide it to off, and the photos simply copy the sketch.