Giter VIP home page Giter VIP logo

vanilla-gan-tf2's Introduction

vanilla-gan-tf2

Here you will find the simplest and easy to follow TF 2.0 implementation for Generative Adversarial Network.

I have made it as simple as possible for those who want to understand the main idea behind GAN

What is GAN ?

Alt text

For short description read this wikipedia Generative Adversarial Nets article.

How the generator outputs images that is identical to distribution of the training examples by sampling from random noise ?

Ok first, Do you have any idea on how to sample from arbitrary and complex probability distribution function ? There are different techniques that are aimed at generating complex random variables such as inverse transform method, rejection sampling, Metropolis-Hasting algorithm and others.

Let's talk about inverse transform method which is simply to represent a complex random variable X as the result of a function applied to a uniform random variable Z that we know how to generate from (like uniform distribution)

Given that the random variable X is fully defined by its Cumulative Distribution Function (CDF), Then we can generate random samples from the X using its Inverse Cumulative Distribution Function (ICDF) as shown below

Alt text

where z is sampled from unifrom distribution (That's easy to sample from) and x is calculated using ICDF of the complex random distribution function X.

How all of above is related to GAN ?

We want the generator to produce images that have the same underlying distribution of the training examples. But we don't know any thing about this underlying distribution (Let think what if you don't have the ICDF in the above method!) What could we do ?

We can use neural network to represent this transform function that map from simple probability distribution function to a complex and unknow disitibution function using the below algorithm

Training algorithm

Find below the training algorithm for GAN as introduced in 2014 by Ian J. Goodfellow and co-authors in Generative Adversarial Nets paper

Alt text

References

  • GAN paper by Ian J. Goodfellow and co-authors.

Contact

To ask questions or report issues, please open an issue on the issues tracker

vanilla-gan-tf2's People

Contributors

eng-amrahmed avatar

Watchers

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