Coder Social home page Coder Social logo

gan_test's Introduction

收集的一些GAN网络

部分测试结果对比

说明:

  1. 生成器基本结构都是卷积网络
  2. 缩写含义:SN - 谱归一化(Spectral Normalization);EMA - 权重滑动平均(Exponential Moving Average)
  3. 训练数据集使用CASIA-maxpy-clean,去除单色图片

DCGAN + 正则项

iter 3000 iter 5000
dcgan_reg_3000 dcgan_reg_5000

DCGAN + 正则项 + EMA

iter 3000 iter 5000
dcgan_reg_ema_3000 dcgan_reg_ema_5000

DCGAN + SN

iter 3000 iter 5000
dcgan_sn_3000 dcgan_sn_5000

DCGAN + SN + EMA

iter 3000 iter 5000
dcgan_sn_ema_3000 dcgan_sn_ema_5000

RSGAN + SN

iter 3000 iter 5000
rsgan_sn_3000 rsgan_sn_5000

WGAN + SN

iter 3000 iter 5000
wgan_sn_3000 wgan_sn_5000

WGAN-GP

iter 3000 iter 5000
wgan_gp_3000 wgan_gp_5000

WGAN-DIV

iter 3000 iter 5000
wgan_div_3000 wgan_div_5000

GAN-QP + L1

iter 3000 iter 5000
gan_qp_l1_3000 gan_qp_l1_5000

GAN-QP + L1 + EMA

iter 3000 iter 5000
gan_qp_l1_ema_3000 gan_qp_l1_ema_5000

GAN-QP + L2

iter 3000 iter 5000
gan_qp_l2_3000 gan_qp_l2_5000

GAN-QP + L2 + EMA

iter 3000 iter 5000
gan_qp_l2_ema_3000 gan_qp_l2_ema_5000

GAN-QP 生成大图测试

运行参数:

img_img_dim = 64
z_dim = 100
L1_or_L2 = 'L1'
batch_size = 64
iter 10000
无EMA gan_qp_l1_256_10000
EMA gan_qp_l1_ema_256_10000

在Keras 2.3.1使用权重滑动平均(EMA)的patch

diff --git a/keras/engine/training.py b/keras/engine/training.py
index 0a556f21..1a9a374e 100644
--- a/keras/engine/training.py
+++ b/keras/engine/training.py
@@ -328,7 +328,7 @@ class Model(Network):
                 self.train_function = K.function(
                     inputs,
                     [self.total_loss] + metrics_tensors,
-                    updates=updates + metrics_updates,
+                    updates=updates + metrics_updates + (self._other_metrics if hasattr(self, '_other_metrics') else []),
                     name='train_function',
                     **self._function_kwargs)

EMA的实现见keras/utils.pyExponentialMovingAverage。使用EMA的例子见keras/dcgan_sn_ema.py

最新代码中的EMA已不需要此patch

原始代码来源

gan_test's People

Contributors

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