Counting 3,834 Big Data & Machine Learning Frameworks, Toolsets, and Examples...
Suggestion? Feedback? Tweet @stkim1

Last Commit
Mar. 30, 2019
Jul. 19, 2018

A series of experiments on using Compositional Pattern Producing Networks and GANs. See the two part blog posts here and here.


Generate abstract images with vanilla Compositional Pattern Producing Networks

Generate images by running:

python CPPN/



Generate abstract images with Vanilla GANs

Code is pretty unstable. Feel free to experiment with what is in the CPPN-GAN-OLD folder.



Generate images with CPPNs and Wasserstein GANs.

Working with datasets (CIFAR10 and CASIA)

CIFAR-10: Download CIFAR-10 (Python version) at and place files into cifar-10-batches-py/

CASIA: CASIA is a bit cumbersome to use. Currently tflib/ create a custom PyTorch dataloader to download the data, and then transform them into squares (since the raw data comes in various dimensions). The file makes use of the pycasia library. CASIA will automatically download; however the file may take a long time due to being hosted on Chinese servers. After the file is downloaded pycasia.load_dataset() also takes forever to load all of the competition-gnt file. The whole file is broken up into ~60 chunks, so I recommend first taking one chunk and loading that (move all the other files away from the data folder temporarily), before trying the entire dataset, to save time.

Training the models

You can train by running e.g. :


Models take a few hours to train even on a GPU. Repo comes with pre-trained models of the generator.

Generating Images

Run to generate images and gifs. In the main method you can edit the dimensions and samples you wish to create.


Large Generated Images:


Trained Samples:

Special Thanks

Many thanks to:

  • @Hardmaru for inspiring this work
  • @caogang for their WGAN-GP implementation which I heavily relied on for my code.
  • @lucaskjaero for their pycasia library