ganhacks README

The project's README from github.com/soumith/ganhacks. As one markdown file: README.md.

(this list is no longer maintained, and I am not sure how relevant it is in 2020)

How to Train a GAN? Tips and tricks to make GANs work

While research in Generative Adversarial Networks (GANs) continues to improve the fundamental stability of these models, we use a bunch of tricks to train them and make them stable day to day.

Here are a summary of some of the tricks.

Here's a link to the authors of this document

If you find a trick that is particularly useful in practice, please open a Pull Request to add it to the document. If we find it to be reasonable and verified, we will merge it in.

1. Normalize the inputs

2: A modified loss function

In GAN papers, the loss function to optimize G is min (log 1-D), but in practice folks practically use max log D

In practice, works well:

3: Use a spherical Z

cube

sphere

4: BatchNorm

batchmix

5: Avoid Sparse Gradients: ReLU, MaxPool

6: Use Soft and Noisy Labels

7: DCGAN / Hybrid Models

8: Use stability tricks from RL

9: Use the ADAM Optimizer

10: Track failures early

11: Dont balance loss via statistics (unless you have a good reason to)

For example

while lossD > A:
  train D
while lossG > B:
  train G

12: If you have labels, use them

13: Add noise to inputs, decay over time

14: [notsure] Train discriminator more (sometimes)

15: [notsure] Batch Discrimination

16: Discrete variables in Conditional GANs

17: Use Dropouts in G in both train and test phase

Authors

ganhacks (soumith/ganhacks)

Searching Database…

11.6K ·GitHub
What is this?A short cheat sheet of practical tips and tricks for training Generative Adversarial Networks (GANs), originally put together as a handout from the 'How to Train a GAN?' session at NIPS 2016.
Is this a tool or just a reference list?It's a plain markdown document, not software — a numbered list of 17 tricks covering things like normalization, loss tweaks, label smoothing, and optimizer choice, with no code to run or install.
How is the list organized?The tricks are numbered 1 through 17, each a short, standalone technique such as batch normalization, using a spherical Z, soft/noisy labels, DCGAN, Adam optimizer, or tracking failures early, with references to the papers they come from.
Is this still actively maintained?No — the README itself warns it hasn't been updated since the original 2016 talk and the author isn't even sure how relevant the tricks still are as of 2020.
Does it recommend a specific GAN architecture to start with?Yes, it suggests using DCGAN whenever possible since it works reliably, and falling back to a hybrid like KL+GAN or VAE+GAN if DCGAN isn't stable for your case.
Which optimizer does it suggest?Adam for the generator, with SGD for the discriminator offered as an alternative combination.
Who compiled this list?It was put together by Soumith Chintala, Emily Denton, Martin Arjovsky, and Michael Mathieu.
Creator
soumith
Size
0.8 MB
Stars
11.6K
Updated
CommitMar 05
Age
9y
Commits · 90 Days