目录
有以下两篇:
训练 GAN 需要在生成器和判别器的参数上求解一个极小极大问题。由于生成器和判别器通常被参数化为深度卷积神经网络,这个极小极大问题在实践中非常困难。
作者主要从损失函数、判别器的正则化与归一化、生成器与判别器的架构、评估度量与数据集等 5 个方面进行了讨论。
代码:https://github.com/google/compare_gan 安装: clone下来
然后需要修改一下setup.py,改为:
scripts=[
'compare_gan/bin/compare_gan_generate_tasks',
'compare_gan/bin/compare_gan_prepare_datasets.sh',
'compare_gan/bin/compare_gan_run_one_task',
'compare_gan/bin/compare_gan_run_test.sh',
],
然后安装
pip install -e .
然后运行下面的代码,把数据集准备好
cd bin && bash -x compare_gan_prepare_datasets.sh
## 可能需要修改一下t2t_datagen的路径,例如:
#T2T_DATAGEN="$HOME/.local/bin/t2t-datagen"
#T2T_DATAGEN="/usr/local/lib/python3.6/site-packages/tensor2tensor/bin/t2t_datagen.py"
注意,这两个数据集没装:
Lsun bedrooms dataset: If you want to install lsun-bedrooms you need to run t2t-datagen yourself (this dataset will take couple hours to download and unpack).
CelebaHQ dataset: currently it is not available in tensor2tensor. Please use the ProgressiveGAN https://github.com/tkarras/progressive_growing_of_gans for instructions on how to prepare it.
然后就可以跑了(compare_gan_generate_tasks
和compare_gan_run_one_task
是安装的两个bin)
# Create tasks for experiment "test" in directory /tmp/results. See "src/generate_tasks_lib.py" to see other possible experiments.
compare_gan_generate_tasks --workdir=/tmp/results --experiment=test
# Run task 0 (training and eval)
compare_gan_run_one_task --workdir=/tmp/results --task_num=0 --dataset_root=/tmp/datasets
# Run task 1 (training and eval)
compare_gan_run_one_task --workdir=/tmp/results --task_num=1 --dataset_root=/tmp/datasets