GithubHelp home page GithubHelp logo

rand0musername / gan_lecture_materials Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bgavran/gan_lecture_materials

0.0 2.0 0.0 26.57 MB

Generative Adversarial Networks presentation and workshop materials for the Petnica Summer School on Machine Learning

Python 24.53% TeX 57.81% Jupyter Notebook 17.67%

gan_lecture_materials's Introduction

Generative Adversarial Networks Lecture

Petnica Summer School on Machine Learning 2017

This repository contains the presentation and the code for the workshop for the GAN lecture on PSIML 2017.


Workshop starting point

You will be training your own Wasserstein GAN with Gradient Penalty on the Labeled Faces in the Wild dataset.

The code uses Python 3.6 and TensorFlow 1.2.0rc1 version (but TensorFlow >= 1.0 should be fine).

The data loading pipeline and most of the boilerplate code is already written.

Your task is to download the dataset and fill in the missing parts of the code.

You should be able to train a rudimentary WGAN-GP with fully connetcted generator and critic on a low resolution Faces dataset in a matter of minutes, even on the CPU of a low-end PC.


Step 1. - Download the dataset

The recommended version is the deep funneled version. The code will look for images recursively in the code/data/lfw-deepfunnelled directory.

Step 2. - Fill in the missing parts of the code!

Starting point is the main.py file, which sets up and trains your model, but the only file you need to edit is code/src/wgan.py.

There are three things you need to implement:

  • Cost functions for the critic and the generator
  • Optimizers for the critic and the generator
  • Training regime

Network architectures for the generators and the critics are already provided. Place for your code is marked in the file. Although you don't need to touch anything else to make it work, feel free to experiment and adjust the code to your liking!

Step 3. - Train your model!

Run the main.py and check your model performance in TensorBoard!

Run the tensorboard --logdir=log --reload_interval=1 from your code/ directory and access the localhost:6006 address from your browser. You'll be able to track values of losses, generated images as well as the distribution of weights and gradients of all the parameters in your network.

For reference, Intel i5-4200U CPU @ 1.60GHz trains the basic shape of the face within first 200 iterations!

Step 4.

???

Step 5.

Profit!!!

Feel free to expriment with various architectures for generator and the critic!

Download some other dataset!

Try removing the Lipschitz regularization and see how the model fails!

Try to figure out your own way to enforce the Lipschitz constraint! (and publish a paper about it!)

If you have access to a GPU farm, try generating HD images!

gan_lecture_materials's People

Watchers

 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.