← all repositories
jacobgil/keras-dcgan

A GAN so vintage it assumes Theano is still alive

A straightforward Keras port of the 2015 DCGAN paper, frozen in time with Theano dimension ordering and a single-file implementation.

keras-dcgan
Velocity · 7d
+0.3
★ / day
Trend
steady
star history

What it does Trains a generator and discriminator in lockstep: the generator learns to fake images convincing enough to fool the discriminator, while the discriminator learns to spot the fakes. After training, you can generate new images or cherry-pick the top 5% by discriminator score with a --nice flag.

The interesting bit This is a period piece. Written when Keras defaulted to Theano, it requires you to flip image_dim_ordering to "th" even for TensorFlow — which the README cheerfully notes “will be slower.” The entire implementation fits in one dcgan.py file with CLI flags for train and generate modes.

Key highlights

  • Single-file implementation of the Radford et al. 2015 DCGAN paper
  • --nice mode filters outputs to the discriminator’s top 5%
  • Includes a training process GIF showing progressive image refinement
  • ~978 stars suggests it served as a reference implementation for many

Caveats

  • Hardcoded for Theano dimension ordering; TensorFlow users take a performance hit
  • No mention of modern conveniences: no GPU memory growth handling, no mixed precision, no checkpointing strategy beyond implied manual restarts
  • README doesn’t specify dataset requirements, image sizes, or expected training time

Verdict Worth a quick look if you’re studying GAN history or need a minimal, no-abstraction DCGAN to hack on. Skip it if you want production-ready code — this is a 2015 paper ported to 2015-era Keras, and it shows.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.