← AI lab

Not a trained GAN. There is no discriminator and no training. The weights are set by hand. The page shows how a generator maps a random vector to an image; the image is a weighted blend of the digits 0–9 drawn in a monospace font.

How it works

StepWhat the code does
Random vector10 numbers in [-1, 1] from a seeded random generator (Mulberry32). Same seed, same images.
Mixing layerA fixed 10×10 weight matrix plus bias turns the vector into 10 scores, one per digit.
TemperatureScores are divided by the temperature, then passed through softmax. The result is 10 weights that sum to 1.
Digit imagesEach digit 0–9 is drawn once in IBM Plex Mono on a 28×28 canvas.
OutputEach pixel is the weighted sum of the ten digit images, shown as grayscale.

Controls

  • Seed: picks the random vectors. Each seed gives 9 images.
  • Temperature: low values push the weights toward one digit (cleaner images). High values spread them out (blurrier blends).
  • Generate batch: adds 1 to the seed.
  • Randomize seed: picks a random seed.
  • Coefficient readout: the 10 digit weights for each image.

Demo

0.75
Coefficient readout

  

Notes

  • The digit images are drawn in the browser, so no image files are downloaded.
  • All math uses typed arrays in plain JavaScript.
  • A trained GAN would learn its weights from real handwriting (for example MNIST). This page does not.