Giter Site home page Giter Site logo

gan's Introduction

Wasserstein GAN with Gradient Penalty (WGAN-GP) in TensorFlow

Description

This is my TensorFlow implementations of Wasserstein GANs with Gradient Penalty (WGAN-GP) proposed in Improved Training of Wasserstein GANs.The key insight of WGAN-GP is as follows. To enforce Lipschitz constraint in Wasserstein GAN, the original paper proposes to clip the weights of the discriminator (critic), which can lead to undesired behavior including exploding and vanishing gradients. Instead of weight clipping, this paper proposes to employ a gradient penalty term to constrain the gradient norm of the critic’s output with respect to its input, resulting the learning objective:

This enables stable training of a variety of GAN models on a wide range of datasets.

Prerequisites

Running the Notebook

  • This Notebook uses the Dataset obtained from Kaggle

  • Open up the train.ipynb file. Then make sure to change the variables

     PHOTO_PATH = "YOUR DATASET PATH HERE"
     MODEL_PATH = "MODEL PATH HERE"
     SAVE_PATH = 'MODEL SAVE PATH HERE'

    to point to your desired Path folders.

  • Make sure to give the EPOCHS variable a higher number to get a more realistic result

  • Now run the notebook

Use the trained generator model to generate faces

  • Open generate_face.py and change the variable

     MODEL_PATH = "YOUR FINAL MODEL PATH"

    to point to your desired Model Path.

  • Now run the file using :

     python generate_face.py

Generate a video of the training process

  • Open generate_face.py and change the variable
     DATA_PATH = "MODEL FOLDER"
    to point to your desired Model Folder.
  • Now run the file using :
     python generate_video.py

gan's People

Contributors

cynamide avatar

Stargazers

It's capy! [orb/acc] avatar  avatar Amarendra Shendkar 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.