Git Product home page Git Product logo

dcgan's Introduction

DCGAN

Keras implementation of the following paper on MNIST database.

Radford, Alec, Luke Metz, and Soumith Chintala. "Unsupervised representation learning with deep convolutional generative adversarial networks." arXiv preprint arXiv:1511.06434 (2015).
link to paper

Dependencies

  • Keras
  • Numpy
  • matplotlib
  • sklearn ( used only for shuffling the data )

Usage

  • dcgan.py, main file.

  • generateRandom.py, uses the saved trained model generator_200.h5 inside the models folder to generate images.

  • metrics folder contains the discriminator loss and generator loss after every epoch saved in numpy's npy format.

Results

  • Generated images after the final epoch

  • GIF of the network learning the handwritten digits after every 5 epoch

Note

  • Using batch normalization as suggested in the paper did not work as expected. Do let me know if I have erred.

  • The data is normalized before being fed into the network

  • I have concatenated both the train and val data for the train dataset thus 70000 samples of 28*28 each.

  • While runnning generateRandom.py you might get an error initNormal not a valid initializations or something like that. Keras does not save the user initialized functions in the model, to resolve this error, add the following in python/site-packages/keras/initializations.py. This ensures that all the weights are initialized from a zero centered normal distribution with standard deviation 0.02.

      def initNormal(shape, name=None):
        return normal(shape, scale=0.02, name=name)
    

dcgan's People

Contributors

rajathkmp avatar

Watchers

James Cloos avatar  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.