Google’s modular GAN rig: one codebase, eight papers, many metrics
A modular TensorFlow framework designed to isolate which GAN tricks actually improve results.

What it does
compare_gan bundles TensorFlow implementations of common GAN building blocks—losses, penalties, normalization schemes, architectures, and evaluation metrics—into a single, Gin-configurable codebase. Researchers mix and match components from a shared menu instead of reimplementing BigGAN or ResNet from scratch, then run experiments on GPUs, TPUs, or CPUs. It functions like a laboratory instrument for controlled generative-model studies.
The interesting bit
The framework treats GAN research as a combinatorial experiment: keep the data pipeline and training loop constant while swapping losses, normalization, or architecture. That discipline is how Google produced papers like Are GANs Created Equal? and The GAN Landscape—by controlling variables in one shared rig rather than comparing numbers across disparate repositories.
Key highlights
- Bundles losses (non-saturating, least-squares, WGAN), penalties (gradient penalty), normalization (spectral, batch, layer), and architectures (BigGAN, ResNet, DCGAN)
- Includes evaluation metrics: FID, Inception Score, precision-recall, and KID
- Configurable via Gin, so experiments are defined declaratively rather than by editing source code
- Runs on GPU, TPU, or CPU
- Backed at least eight published papers, including NeurIPS 2018 and ICML 2019 work
Caveats
- Evaluation on TPUs is not supported; you will need a separate GPU VM for that
- Training and evaluation simultaneously can exhaust memory on a single local GPU
- ImageNet and CelebA-HQ require manual dataset download and preparation
Verdict
Researchers running GAN ablation studies or reproducing Google’s generative papers should start here. If you need a plug-and-play image generator or a PyTorch-native tool, this is not your repo.
Frequently asked
- What is google/compare_gan?
- A modular TensorFlow framework designed to isolate which GAN tricks actually improve results.
- Is compare_gan open source?
- Yes — google/compare_gan is open source, released under the Apache-2.0 license.
- What language is compare_gan written in?
- google/compare_gan is primarily written in Python.
- How popular is compare_gan?
- google/compare_gan has 1.8k stars on GitHub.
- Where can I find compare_gan?
- google/compare_gan is on GitHub at https://github.com/google/compare_gan.