/transformer-GAN

Vision Transformer GAN Architecture

Primary LanguagePython

Vision Transformer only GAN (Gen and Discr) - Pytorch

1. Related work:

Original paper: Jiang, Yifan, Shiyu Chang, and Zhangyang Wang. "Transgan: Two transformers can make one strong gan." arXiv preprint arXiv:2102.07074 (2021). 

TransGAN: Two Transformers Can Make One Strong GAN

Code inspired from TransGAN

2. GAN Architecture

Architecture

3. Self-attention masking

Self-Attention

4. Gradually Increasing Receptive Field

masking

5. Difference from original paper

  • GELU activation is only approximated through: to speed up computations done at GPU.

  • MLP is formed by Fully Connected => GELU ==> Fully Connected => GELU

6. Install requirements

pip install -r requirements.txt

Python version >= 3.6

7. Training

python train.py

8. Jupyter notebook

Use Untitled.ipynb to easily modify training parameters