BEGAN is a generative adversarial network (GAN) that aims to solve the mode collapse problem common in GAN training. It introduces a novel loss function to encourage the generator to produce diverse samples that cover the data distribution more effectively. This project replicates the original paper
- Boundary Equilibrium Loss: BEGAN utilizes a loss function that measures the balance between the real and fake data distributions at the boundaries of the data space.
- Improved Sample Diversity: By encouraging the generator to produce samples that explore the data boundaries, BEGAN promotes diversity and prevents mode collapse.
- Hyperparameter-Free Training: Unlike traditional GANs that require careful hyperparameter tuning, BEGAN automatically adjusts its behavior based on the data distribution, making it easier to train.
- PyTorch
- Numpy
- CUDA
1. Clone the Repository
git clone https://github.com/vimmoos/BE_GAN.git2. Install Dependencies
cd began
pip install -r req.txtMoreover, this project uses wandb. Therefore you need to have an wandb account and you need to be logged in. To login use wandb login.
3. Prepare Data
Download the CelebA dataset from here link. You will probably download a file named img_align_celeba.Unzip it into the data/ directory and rename the extracted folder to celeba
Then run the following command from the root folder of the project:
python data/face_detect.pyThis will perform the necessary preprocessing.
4. Train
Simply run the following python command from the root folder:
python -m began.mainIn order to change the parameters either use wandb or change the default on in the began/main.py file.
5. Generation
python -m began.generateThis will generate a series of images that were generated from the model during different phases of the training.
