Giter Club home page Giter Club logo

ezgan's Introduction

ezgan

An extremely simple generative adversarial network, built with TensorFlow. I've written it as a personal exercise to help myself grasp the basics of GANs, and hope that it might be a useful illustration.

In order to stabilize the GAN's training and accelerate the process altogether, this model uses what I'd call "guided training:" a controller in the training loop trains either the generator, the discriminator on real samples, or the discriminator on generated samples depending on which part of the model shows the greatest losses. Thus it avoids both mode collapse, which tends to arise when the generator overpowers the discriminator, as well as the opposite scenario in which the discriminator becomes highly certain and eliminates the gradient that the generator needs in order to refine its variables. All of that is possible through careful tuning of hyperparameters, but I've found this approach to be a little less painstaking.

Visit EZGAN.ipynb for a full explanation with interactive code, or run gan-controlled.py directly. Note that the Python script produces very little printed output; it sends scalar summaries and sample images to TensorBoard and saves model checkpoints every 5,000 training steps.

Both the notebook and the Python script use a clever functional approach to feeding the output of the generator into the descriminator that comes from Adit Deshpande, with whom I'm collaborating on a forthcoming O'Reilly tutorial on GANs.

This GAN generates images like these cherry-picked examples:

ezgan's People

Contributors

jonbruner avatar springle avatar

Watchers

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