Git Product home page Git Product logo

art-dcgan-keras's Introduction

Art DCGAN in Keras

WIP of Robbie Barrat's Art DCGAN in Keras.

Inspiration

I didn't know how GANs worked, and I wanted to know how GANs worked... oh, and that AI painting sold for $432,500.

Since Torch is an utter nightmare to install on Windows, here's a Keras implementation of Barrat's Art DCGAN

The code was originally Jason Brownlee's CIFAR10 GAN before I butchered it

The topology of the Discriminator and Generator are from Barrat's Art DCGAN with fewer filters so it doesn't OOM on a GTX980Ti

Model based on Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks (2015 preprint, Radford, et al.)

Usage

Currently, images MUST be RGB and 128x128

python keras-art-dcgan.py -dataset=datasetname

Image data should all be in /data/datasetname

Four examples and models are saved every time an epoch is finished

Save and Load models

python keras-art-dcgan.py -dataset=datasetname -save_model=faces -load_model=faces

The d and g models will be saved into ./output/weights/ as faces-d.h5 and faces-g.h5 The d and g models will be loaded from the above, selecting the -d and -g is automated, just provide a name

Requirements

  • Keras
  • Tensorflow (or Theano if you switch it to channels last)
  • NumPy
  • Pillow
  • progressbar

To do

This is very heavily a WIP!

Wishlist:

  • Let user define network hyperparameters
  • Dynamic image input size
  • Allow images of only one colour channel
  • Figure out a better topology for faster learning
  • Figure out a better topology to prevent failure cases (eg. losses hitting 0 and training ceasing)
  • Properly implement and test Barrat's topology - currently I am using a GTX980Ti which doesn't have enough memory for the amount of filters he uses in the two networks. I've watered it down slightly as to have fewer parameters

Issues

Sometimes, depending on data, losses can hit 0 and training will cease.

I'm not sure (yet) how to fix this if it's the Generator, but if the Discriminator is too strong then it can help to add Leaky ReLu or Dropout between the CNN layers.

Datasets should be relatively varied, but not so much as to throw the model off-genre (unless that's what you're going for!)

Have fun!

I'd love to see what you generate using this, please post your synthesised images!

Cheers,

Jordan J. Bird

http://jordanjamesbird.com/

art-dcgan-keras's People

Contributors

jordan-bird avatar

Stargazers

Ana-Maria Comorasu avatar sandeep kirwai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.