hr-studioAI · 02
A computational design primer · Autoencoders & the VAE

A space it taught itself.

Last chapter we built a latent space by hand. Now a network learns one on its own: squeeze each design through a bottleneck so narrow that only its essence survives, force it to rebuild the original from that pinch of numbers, and a map of all designs quietly organizes itself in the middle. Make that map smooth and dense — the variational trick — and the decoder becomes a generator you can sample from. Every shape you'll see below is decoded live from a small VAE trained for this page.

Scroll to begin
i.

Squeeze, then rebuild

An autoencoder is two networks facing each other. The encoder crushes a shape's sixty-four numbers down to just two; the decoder has to reconstruct the whole shape from only those two. The bottleneck is a tollgate that lets nothing through but the essentials — so the two numbers it keeps are the design's essence.

Morph the input. The reconstruction tracks it — never pixel-perfect, but always faithful.

64 numbers → 2 → 64 · the bottleneck
ii.

A map it organized itself

Plot where the encoder sends each shape and a map appears — lookalikes landing together, families flowing into families. Nobody arranged it; minimizing reconstruction error forced a tidy code. And because the decoder turns any code back into a shape, the gaps between real shapes are full of new ones: a whole sheet of designs nobody drew.

Every tile below is the decoder's output for that spot on the map.

Decoded latent sheet · hover to inspect
iii.

A cloud, not a point

Here's the variational twist. Instead of sending each shape to one exact spot, the VAE sends it to a little cloud — a mean and a spread — and trains on samples drawn from it. A gentle pressure keeps every cloud near the centre and overlapping its neighbours, so the clouds tile the space with no holes. The payoff: anywhere you land decodes to something real.

Each dot is a sample from this shape's cloud, decoded. Same idea, gentle variations.

Encode → distribution → sample
iv.

Blending by arithmetic

Two shapes, two codes; average them and decode, and you get a true blend. Slide the average from one end to the other and the design morphs through a chain of plausible in-betweens — because the space is dense, every step lands on something valid. Generation becomes arithmetic in the latent space.

This smooth, hole-free travel is exactly what the variational pressure bought us.

latent interpolation · A → B
v.

The generative field

The decoder, set loose. Drag anywhere and the shape under your cursor is generated on the spot from those two coordinates — a continuous field of designs with the real shapes scattered as landmarks. Or hit sample, and a random draw from the centre of the space glides into a fresh design, guaranteed to be valid because the VAE left no empty ground. This single trained decoder is a generator; the rest of generative AI is mostly better decoders and bigger maps.

Drag to generate · sample for a random design
Force a network to rebuild what it sees through a pinhole and it invents a language for the data; smooth that language and the decoder becomes a generator. From here, diffusion and GANs are variations on one theme — learn the map, then walk it.