Giter Site home page Giter Site logo

dl_hw3's Introduction

Homework 3 for Deep Learning

Environment

  • ubuntu 16.04 LTS
  • python3.5.2
  • tensorflow 1.4.1
  • GPU: Tesla P100

Variational Autoencoder

In this task, I used convolution layers to construct VAE, and trained it with L2 loss on an anime character faces dataset (> 50000 of 96x96 samples) provide by the course TA. I think it was collected using the procedure described here.

$ python3 train_VAE.py

After training, the model will plot the training loss curve and some examples before encoded and after decoded, to compare the differences; it will also generate some random images by sampling the latent space distribution.

Generative Adversarial Network

I construct a regular diabolo shaped GAN network, and trained it on the same dataset with some augmentation. train_DCGAN used traditional GAN objective function, while train_LSGAN used L2 loss as objective function described here. By testing it seems like LSGAN is more robust.

The model will continually plot some generated images with fixed noise while training, and plot the learning curve of generator and discriminator after training.

$ python3 train_DCGAN.py
$ python3 train_LSGAN.py

Training curve of DCGAN:

Training curve of LSGAN:

Things I have learned

  1. To find the balanced of discriminator and generator is hard. I ended up adding dropout layers in discriminator, gaussian noise on all the images (including faked samples), and update generator twice every iterations, so that the performance of discriminator can be suppress.
  2. Batch normalization maybe be helpful to accelerate training, but it also make the generator harder to compete with the discriminator. Besides, I personally don't like the images produced with batch normalization = =.
  3. Adam optimizer also good to accelerate the process, but same reason, the image looks a little weird.

dl_hw3's People

Contributors

yoyololicon avatar

Stargazers

 avatar

Watchers

 avatar  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.