Skip to content

A PyTorch Implementation of Deep Convolutional Generative Adversarial Networks

License

Notifications You must be signed in to change notification settings

hagerrady13/DCGAN-PyTorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DCGAN-PyTorch

A PyTorch implementation of Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks

Table of Contents:

Project Structure:

├── agents
|  └── dcgan.py # the main training agent for the dcgan
├── graphs
|  └── models
|  |  └── discriminator.py  # discriminator model definition
|  |  └── generator.py  # generator model definition
|  └── losses
|  |  └── loss.py # contains the binary cross entropy 
├── datasets  # contains all dataloaders for the project
|  └── celebA.py # dataloader for celebA dataset
├── data
|  └── celebA  # contains all celebA images
├── utils # utilities folder containing metrics , config parsing, etc
|  └── assets
├── main.py
├── run.sh

Data Preparation:

CelebA dataset has been used. All images are resized to 64x64. Data are placed into data/ folder.

Model:

alt text

This is the model we used in our implementation. However, the number of filters in our implementation goes from 512 -> 256 -> 128 -> 64. This can be tuned in the configurations file be editing the variables: num_filt_g and num_filt_d.

Experiment configs:

- Input size: 64x64x3
- Batch size: 64
- Learning rate: 0.0002
- Betas for Adam: 0.5 and 0.999
- Number of epochs: 30
- Noise vector size: 100
- Starting number of generator filters: 64
- Starting number of discriminator filters: 64

Usage:

  • To run the project, you need to add your configurations into the folder configs/. An example of the configurations that should be passed can be found here
  • sh run.sh
  • To run on a GPU, you need to enable cuda in the config file.

Results:

Loss:

alt text

Generated Images after training:

alt text

Requirements:

  • Pytorch: 0.4.0
  • torchvision: 0.2.1
  • tensorboardX: 1.2

Check requirements.txt.

References:

License:

This project is licensed under MIT License - see the LICENSE file for details.

About

A PyTorch Implementation of Deep Convolutional Generative Adversarial Networks

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published