phamgialinhlx / GANs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


GAN Implementation

PyTorch Lightning Config: Hydra Template

Description

My implementation of GAN, DCGAN, cGAN.

How to run

Install dependencies

# clone project
git clone https://github.com/phamgialinhlx/GANs
cd GANs

# [OPTIONAL] create conda environment
conda create -n gan python=3.8 -y
conda activate gan

# install pytorch according to instructions
# https://pytorch.org/get-started/

# install requirements
pip install -r requirements.txt

Train model with default configuration

# train on CPU
python src/train_gan.py trainer=cpu

# train on GPU (default)
python src/train_gan.py 

You can override any parameter from command line like this

# train on FashionMNIST dataset
python src/train_gan.py datamodule=fashion_mnist
# use cGAN model
python src/train_gan.py model=cgan
# use DCGAN model with small architecture (image size: 28 x 28)
python src/train_gan.py model=small_dcgan 

Results

Unconditional generation

Conditional generation

About


Languages

Language:Jupyter Notebook 95.9%Language:Python 4.1%Language:Makefile 0.0%Language:Shell 0.0%