-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from hanzhanggit/dev
add sagan
- Loading branch information
Showing
19 changed files
with
528 additions
and
1,188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.idea/ | ||
__pycache__/ | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,47 @@ | ||
# Spectral Normalization and projection discriminator for Generative Adversarial Networks | ||
# Self-Attention GAN | ||
Tensorflow implementation for reproducing main results in the paper [Self-Attention Generative Adversarial Networks](https://arxiv.org/abs/1805.08318) by Han Zhang, Ian Goodfellow, Dimitris Metaxas, Augustus Odena. | ||
|
||
* Implementation of these papers: | ||
* Spectral Normalization. https://openreview.net/pdf?id=B1QRgziT- | ||
* Projection Discriminator. https://openreview.net/pdf?id=ByS1VpgRZ | ||
* Reference Chainer code: https://github.com/pfnet-research/sngan_projection | ||
<img src="imgs/img1.png"/> | ||
|
||
|
||
### Dependencies | ||
python 3.6 | ||
|
||
TensorFlow 1.5 | ||
|
||
|
||
**Data** | ||
|
||
Download Imagenet dataset and preprocess the images into tfrecord files as instructed in [improved gan](https://github.com/openai/improved-gan/blob/master/imagenet/convert_imagenet_to_records.py). Put the tfrecord files into ./data | ||
|
||
|
||
**Training** | ||
|
||
The current batch size is 64x4=256. Larger batch size seems to give better performance. But it might need to find new hyperparameters for G&D learning rate. Note: It usually takes several weeks to train one million steps. | ||
|
||
CUDA_VISIBLE_DEVICES=0,1,2,3 python train_imagenet.py --generator_type test --discriminator_type test --data_dir ./data | ||
|
||
**Evaluation** | ||
|
||
CUDA_VISIBLE_DEVICES=4 python eval_imagenet.py --generator_type test --data_dir ./data | ||
|
||
### Citing Self-attention GAN | ||
If you find Self-attention GAN is useful in your research, please consider citing: | ||
|
||
``` | ||
@article{Han18, | ||
author = {Han Zhang and | ||
Ian J. Goodfellow and | ||
Dimitris N. Metaxas and | ||
Augustus Odena}, | ||
title = {Self-Attention Generative Adversarial Networks}, | ||
year = {2018}, | ||
journal = {arXiv:1805.08318}, | ||
} | ||
``` | ||
|
||
**References** | ||
|
||
- Spectral Normalization for Generative Adversarial Networks [Paper](https://arxiv.org/abs/1802.05957) | ||
- cGANs with Projection Discriminator [Paper](https://arxiv.org/abs/1802.05637) | ||
- Non-local Neural Networks [Paper](https://arxiv.org/abs/1711.07971) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.