This is code of WGAN-GP using celebA and CIFAR10 datasets.
sang_gan.py : includes model of generator & discriminator and gradient_penalty
sang_main.py : main file of the code
sang_plot.py : functions of plotting generator & discriminator loss, generate images, animation of generate images
sang_utils.py : dataloader of CelebA & Cifar10
wrapper.py : training with parameters
- Python(3.6.9)
- pytorch (1.1.0)
- matplotlib(3.1.0)
- numpy (1.16.4)
In 'sang_main.py', Some hyperparameter which can changed by users included in parser.
- 'dataset' : select the dataset between Cifar10 and CelebA.
- 'latent_dim' : input of latent vector in Generator, normally defaults at 100.
- 'b1, b2' : Adam optimizer parameters (beta 1,2).
- 'img_size' : training image size.
- 'n_critic' : number of discriminator iteration after that, generator updates one time
- 'lambda_gp' : gradient descent parameter
User runs the 'sang_main.py' with changing the list in 'iter_list'. Function 'wrapper' runs with the set of 'iter_list' automatically.