【阅读笔记】Improved Training of Wasserstein GANs
Improved Training of Wasserstein GANs
Gulrajani I, Ahmed F, Arjovsky M, et al. Improved training of wasserstein gans[C]//Advances in Neural Information Processing Systems. 2017: 5767-5777.
GitHub: https://github.com/igul222/improved_wgan_training
Abstract
GAN虽然是个强有力的生成模型,但是训练不稳定的缺点影响它的使用。刚刚提出的 Wasserstein GAN (WGAN) 使得 GAN 的训练变得稳定,但是有时也会产生很差的样本和不收敛。我们发现这些问题的原因常常是因为 weight clipping 来满足 判别器(critic,os.坑,研究了半天才领会这个意思)的 Lipschitz constraint。我们把 weight clipping 转化为成 判别器 的梯度范数关于输入的惩罚。我们的方法优于 standard WGAN 和大部分的 GAN 的变种。
Introduction
Generative adversarial networks
Formally, the game between the generator G and the discriminator D is the minimax objective:
In practice, the generator is instead trained to maximize 。因为这样可以规避当判别器饱和时的梯度消失。
Wasserstein GANs
The WGAN value function is constructed using the Kantorovich-Rubinstein duality to obtain
其中是 1-Lipschitz functions。为了使判别器满足 k-Lipschitz 限制,需要将权重固定在,k是由和模型结构所决定。
Difficulties with weight constraints
如下图所示,发现进行 weight clipping 有两个特点,一是会使得权重集中在所设范围的两端,二是会很容易造成梯度爆炸或梯度消失。这是因为判别器要满足 Lipschitz 条件,但是判别器的目标是使得真假样本判别时差别越大越好,经过训练后,权值的绝对值就集中在最大值附近了。
Gradient penalty
Algorithm 1 WGAN with gradient penalty. We use default values of , , KaTeX parse error: Expected 'EOF', got '\apha' at position 1: \̲a̲p̲h̲a̲=0.0001, , .
Require: The gradient penalty coefficient , the number of critic iterations per generator iteration , the batch size , Adam hyperparameters .
Require: initial critic parameters , initial generator parameters .
- while has not converged do
- for do
- for do
- Sample real data , latent variable , a random number .
- end for
- end for
- Sample a batch of latent variables .
- end while
WGAN-GP 的创新点在与优化了代价函数
对权重增加惩罚项,使得在原始数据和生成数据中间地带的权重的尽量小,相当于把 WGAN 的硬阈值转化为了软阈值。
Experiments
Conclusion
从实验上来看效果好于其他 GAN 方法,但是看其他资料说不一定好于WGAN,以后有空实验一下看看效果。