Giter VIP home page Giter VIP logo

tf-dcgan's Introduction

tf-dcgan

Introduction

This repository contains a TensorFlow implementation of Deep Convolutional Generative Adversarial Networks, with some modifications. Specifically, this implementation makes the following changes:

  • An extra 3x3 convolutional layer is added to the end of the generator network. The body of the discriminator network is left unchanged.
  • Batch normalization is applied to the input of each convolutional layer instead of after.
  • Global average pooling is utilized in the discriminator instead of a densely connected layer.

The discriminator uses ReLU non-linearities instead of LReLU.

These changes were made for experimental purposes, and seem to improve both stability and visual results datasets I'm interested in. They may or may not work better for others. For a DCGAN implementation with the models used in the paper, switch to the original branch.

Requirements

  • Python (2.7 or 3.5)
  • TensorFlow >= 0.8

Usage

To train your own model, clone this repository and run:

python dcgan.py -t <train_dir> -o <output_dir>

This will snapshot weights as well as intermediate generations to the directory specified by <output_dir>. To generate samples from a trained model, simply omit the -t flag:

python dcgan.py -o <output_directory>

For more options, run:

python dcgan.py -h

Samples

All of the images below are artificial creations from the generator network, i.e. the "celebrities" shown below are not actual people.

Celebrities - 64x64 generations on CelebA (resized such that the smaller dimension is 112, followed by a center crop):

Small, canonical images - 64x64 generations on CIFAR-10:

More sample generations on some custom datasets will follow. I'm also planning on training larger outputs (128x128) on larger datasets such as YFCC100M.

Pre-trained Models

Pre-trained models "coming soon" โ„ข.

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.