项目介绍

lilianweng/unified-gan-tensorflow 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,目前获得 125 个 Star、33 次 Fork。

仓库全名
lilianweng/unified-gan-tensorflow
Star 数
125
Fork 数
33
未关闭 Issue
1

README 摘要

Original, Wasserstein, and Wasserstein-Gradient-Penalty DCGAN (\) This repo is a modification of carpedm20/DCGAN-tensorflow. (\) The full credit of the model structure design goes to carpedm20/DCGAN-tensorflow. I started with carpedm20/DCGAN-tensorflow because its DCGAN implementation is not fixed for one dataset, which is not a common setting. Most WGAN and WGAN-GP implementations only work on 'mnist' or one given…

完整内容见 GitHub 原始 README 或本页 。

常见问题

unified-gan-tensorflow 用什么语言开发?

主要使用 Python 编写,目前有 125 个 Star。

如何获取 unified-gan-tensorflow 的源码?

可以直接克隆仓库:git clone https://github.com/lilianweng/unified-gan-tensorflow.git,默认分支为 master;安装与运行步骤见仓库 README。

unified-gan-tensorflow 最近还在维护吗?

仓库最近一次更新为 2018年8月28日,当前有 1 个未关闭 Issue;Star 数为 125,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

A Tensorflow implementation of GAN, WGAN and WGAN with gradient penalty.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
316
价值分
97
活跃状态
活跃

语言占比

Python

README

Original, Wasserstein, and Wasserstein-Gradient-Penalty DCGAN

(*) This repo is a modification of carpedm20/DCGAN-tensorflow.

(*) The full credit of the model structure design goes to carpedm20/DCGAN-tensorflow.

I started with carpedm20/DCGAN-tensorflow because its DCGAN implementation is not fixed for one dataset, which is not a common setting. Most WGAN and WGAN-GP implementations only work on ‘mnist’ or one given dataset.

Modifications

A couple of modifications I’ve made that could be helpful to people who try to implement GAN on their own for the first time.

  1. Added model_type which could be one of ‘GAN’ (original), ‘WGAN’ (Wasserstein distance as loss), and ‘WGAN_GP’ (Wasserstein distance as loss function with gradient penalty), each corresponding to one variation of GAN model.
  2. UnifiedDCGAN can build and train the graph differently according to model_type.
  3. Some model methods were reconstructed so that the code is easier to read through.
  4. Many comments were added for important, or potential confusing functions, like conv and deconv operations in ops.py.

The download.py file stays same as in carpedm20/DCGAN-tensorflow. I keep this file in the repo for the sake of easily fetching dataset for testing.

Reading

If you are interested in the math behind the loss functions of GAN and WGAN, read here.

Test Runs:

(left) python main.py --dataset=mnist --model_type=GAN --batch_size=64 --input_height=28 --output_height=28 --max_iter=10000 --learning_rate=0.0002 --train
(middle) python main.py --dataset=mnist --model_type=WGAN --batch_size=64 --input_height=28 --output_height=28 --d_iter=5 --max_iter=10000 --learning_rate=0.00005 --train
(right) python main.py --dataset=mnist --model_type=WGAN_GP --batch_size=64 --input_height=28 --output_height=28 --d_iter=5 --max_iter=10000 --learning_rate=0.0001 --train

  

评论

暂无评论