A VAE implementation frozen in 2018, still teaching
Minimal Keras code for variational and conditional autoencoders that trades modern frameworks for clarity.

What it does
Implements a standard VAE and a conditional VAE (CVAE) in Keras, with training scripts for CelebA face generation and a clustering variant. The repo is essentially a code companion to two Chinese blog posts by the author.
The interesting bit
The value is in the restraint: no PyTorch, no JAX, no diffusion — just the Keras functional API doing the reparameterization trick and KL divergence by hand. For someone who has read the theory and needs to see it unwrapped, this is the unwrapping.
Key highlights
- VAE and CVAE implementations in ~2018-era Keras/TensorFlow
- CelebA training example with a 64×64 output sample after 100 epochs
- Clustering variant (
vae_cluster) for unsupervised structure learning - Heavily documented by external blog posts (in Chinese) rather than inline comments
- Explicitly pinned to Python 2.7, TensorFlow 1.8/1.13, Keras 2.2.4
Caveats
- Dependencies are end-of-life; expect friction running this on modern Python
- README is sparse — you’ll need the linked blog posts for explanation
- No tests, no packaging, no recent commits visible
Verdict
Grab this if you’re learning VAE mechanics and want to read code that predates the tf.keras.layers.Lambda era. Skip it if you need production-ready generative models or anything that installs without a time machine.