Skip to content
CPPN in Keras 2
Branch: master
Clone or download
Dennis Kerzig
Dennis Kerzig Improved README
Latest commit c1769c8 May 13, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Initial Commit May 12, 2018
.gitignore Initial Commit May 12, 2018 Improved README May 13, 2018 Initial Commit May 12, 2018
requirements.txt Initial Commit May 12, 2018

CPPN in Keras 2

Implementation of a Compositional Pattern Producing Network in Keras 2 with some command-line utilities to easily generate your own images.

Code heavily borrowed from:


I've generated a bunch of patterns in high resolution (2560×1600) and made them available as download. Feel free to tweet it out if you like them.


Other Examples


See requirements.txt. Install all of them via

pip3 install -r requirements.txt


Execute the script with -s to save generated images to disk and/or with -p to display plots of them with pyplot. Additionally the following options are available:

  • --x (int) [Default 500] image-width
  • --y (int) [Default 500] image-height
  • --n (int) [Default 1] amount of images to be generated
  • --variance (int) set this for a fixed variance of the initialized network-weights - Otherwise they will be generated randomly
  • --bw set this flag to generate images in b&w
  • --path (string) [Default ./results] specifies the save-path for images

Example: Save 5 black & white wallpapers for a 13'' Retina screen.

python3 -s --n 5 --x 2560 --y 1600 --bw

Parameters to play with

If you want to change the look of your results, try to tune the following parameters:

  • --variance and --bw script-parameters
  • kernel_initializer, depth and activation of the CPPN in build_model()


  • Implement Video-Functionality
You can’t perform that action at this time.