Git Product home page Git Product logo

gan_basic_example's Introduction

Generative Adversarial Networks (GANs) with 2D Samples

Blog(in Chinese): 用GAN生成二维样本的小例子
Inspired & based on Dev Nag's GAN example:

  1. Use batch size instead of cardinality to achieve better convergency, the original version is actually generating 100 (cardinality by default) dimensional gaussian distribution for discriminator, so the convergency is BAD.
  2. Use 2D samples, with visualization of training.
  3. Demo of conditional GAN.
  4. GPU support.

Introduction

Play with GAN to generate 2D samples that you can define your own probability density function (PDF) with a gray image.
image

2D Sampling

python sampler.py

Will demo 10000 samples from the PDF defined by a gray image.
image
image
image

GAN

python gan_demo.py inputs/zig.jpg

Training will be visualized as the following:
image

More examples:
image
image
image
image

Conditional GAN

For more complex distributions, conditional GAN is much better. This demo reads distributions from different pdfs, encoding conditions as one-hot vector.

python cgan_demo.py inputs/binary

Training will be visualized as the following:
image
Compared to vanilla GAN version:
image

More examples:
Vortex with C-GAN
image

Vortex with vanilla GAN
image

Pentagram with C-GAN
image

Pentagram with vanilla GAN
image

Latent space dimensionality / model complexity / learning rates / ...

python gan_demo.py -h

gan_basic_example's People

Contributors

1587causalai 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.