Code Monkey home page Code Monkey logo

cifar-gan's People

Contributors

gauravmm avatar kingsleykuan avatar owen94 avatar ravoxsg avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cifar-gan's Issues

Use Soft and Noisy Labels

Label Smoothing, i.e. if you have two target labels: Real=1 and Fake=0, then for each incoming sample, if it is real, then replace the label with a random number between 0.7 and 1.2, and if it is a fake sample, replace it with 0.0 and 0.3 (for example).
Salimans et. al. 2016
make the labels the noisy for the discriminator: occasionally flip the labels when training the discriminator

Autorun.sh

Hey,

While running autorun.sh I get the following error :
if [ ! -d .git] ; then (line 6)
raises an invalid syntax error

Probably another Python 3.4 vs Python 3.5 error ?

Parent module '.' not loaded error

I get the following error message :"Parent module '.' not loaded cannot perform relative import" when calling adversarial.py script.

Apparently this line of support (l.163) is responsible for the error:
return lambda modname: importlib.import_module(pkg + "." + modname, package=".")

Perhaps I don't have a module allowing the import of modules when stacking names ?

Cheers,

Console error when calling support.py

Hey,

I receive the following error when trying to compile the experiment :
"module" object has no attribute "label_flipping_prob"
related to support.py line 52:
self.label_dis_real = _selection_stream([args.hyperparam.label_flipping_prob]
And I don't understand the purpose of this attribute of args.hyperparam

Improve logs/weights output

We need to:

  1. Allow a commandline option to override the data prefix.
  2. Move all the same run data into a single subfolder.
  3. Use the preprocessors and the hyperparameters as part of the naming convention.

BatchNorm

Construct different mini-batches for real and fake, i.e. each mini-batch needs to contain only all real images or all generated images.
when batchnorm is not an option use instance normalization (for each sample, subtract mean and divide by standard deviation).

Python 3.4 not supporting *

Hey guys,

I face the following issue, due to my version of Python being 3.4 whereas the initial code was written with Python 3.5.
In the def random_stream function line 91 of support, I had to modify *img_size, as starred expressions are not accepted by Python 3.4. I wrote img_size[0], img_size[1], img_size[2] instead.

Output CSV file printing with square brackets.

2017-03-30 12:28:57, 7, [ 0.83778523  0.        ], [ 0.75879407  0.        ], [ 0.6237818  0.       ]
2017-03-30 12:29:00, 8, [ 0.90475029  0.        ], [ 0.77940774  0.        ], [ 0.58533067  0.        ]
2017-03-30 12:29:03, 9, [ 0.98412164  0.        ], [ 0.78705633  0.        ], [ 0.55018032  0.        ]
2017-03-30 12:29:06, 10, [ 1.12536469  0.        ], [ 0.80081189  0.        ], [ 0.49073929  0.        ]
2017-03-30 12:29:09, 11, [ 1.35740131  0.        ], [ 0.81628722  0.        ], [ 0.43616527  0.        ]

We need to change the output to follow the CSV format.

Track failures early

D loss goes to 0: failure mode
check norms of gradients: if they are over 100 things are screwing up
when things are working, D loss has low variance and goes down over time vs having huge variance and spiking
if loss of generator steadily decreases, then it's fooling D with garbage (says martin)

Write correct CSV Headers

Currently, headers are written as:

time, batch, composite loss, discriminator+real loss, discriminator+fake loss

But data is written as:

2017-03-20 09:07:36s, 50d, [ 0.70245182  0.56332031]f, [ 0.70011313  0.46328125]f, [ 0.7290282   0.26015625]f

The [a, b] sections need to (1) be unwrapped and (2) have appropriate titles inserted.

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

because the first formulation has vanishing gradients early on
Goodfellow et. al (2014)
In practice, works well:

Flip labels when training generator: real = fake, fake = real

Only report relevant metrics.

Currently, we report 12 metrics ([loss, acc, lbl_true, lbl_false] x [labelled, unlabelled, composite]). We can do away with some of these, and reorder the rest accordingly.

DCGAN / Hybrid Models

Use DCGAN when you can. It works!
if you cant use DCGANs and no model is stable, use a hybrid model : KL + GAN or VAE + GAN

Use stability tricks from RL

Experience Replay
Keep a replay buffer of past generations and occassionally show them
Keep checkpoints from the past of G and D and occassionaly swap them out for a few iterations
All stability tricks that work for deep deterministic policy gradients
See Pfau & Vinyals (2016)

Use the ADAM Optimizer

optim.Adam rules!
See Radford et. al. 2015
Use SGD for discriminator and ADAM for generator

Use a spherical Z

Dont sample from a Uniform distribution

Sample from a gaussian distribution

When doing interpolations, do the interpolation via a great circle, rather than a straight line from point A to point B
Tom White's Sampling Generative Networks ref code https://github.com/dribnet/plat has more details

Report smoothed losses.

The current losses are too volatile to be useful. Report a sliding-window average loss instead.

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.