This repository contains Python code for implementing a Wasserstein Generative Adversarial Network (WGAN) with Gradient Penalty (WGAN-GP) using PyTorch.
The WGAN-GP is an extension of the original WGAN that improves training stability and addresses issues like mode collapse. It achieves this by penalizing the norm of the gradient of the critic's output with respect to its input data, which encourages smoother critic functions and helps prevent mode collapse.
The discriminator.py file contains the implementation of the discriminator network used in the WGAN-GP model. It consists of convolutional layers followed by leaky ReLU activations.
The generator.py file contains the implementation of the generator network used in the WGAN-GP model. It consists of convolutional blocks and residual blocks to generate realistic images.
-
Clone the repository:
git clone <repository_url> cd <repository_directory>
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the training script to train the WGAN-GP model.
The dataset used for training the WGAN-GP model is not provided in this repository. You need to prepare your own dataset of images for training.
The WGAN-GP model consists of a generator and a discriminator. The generator generates fake images from random noise, while the discriminator evaluates the realism of the generated images. The training process involves optimizing the generator and discriminator networks simultaneously in a minimax game.
This project is licensed under the MIT License - see the LICENSE file for details.