/dcgan

DCGAN implementation in fastai/pytorch

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

dcgan

DCGAN ( Deep Convolutional Generative Adversarial Networks ) by Alec Radford et al. paper provides an improvement over the original GAN paper by Ian Goodfellow et al.

This project was built with the help of nbdev and fastai to highlight the ease of developing sophisticated deep learning models. Most of the code is inspired from this project

sample

Install

pip install git+https://github.com/numb3r33/dcgan.git

How to use

#ignore
path = untar_data(URLs.MNIST)
dls  = get_dls(path, bs=128)
#ignore
dc_gan = DCGAN(ch_in=1,
               z_dim=64
               )

learn = dcgan_learner(dls, dc_gan, opt_func=partial(Adam, betas=(0.5, 0.999)))
#ignore
learn.fit(n_epoch=75, lr=2e-4)

How generator learns during various epochs of training. One can see the quality of images improving over time.

generator generation

#ignore
learn.show_results(ds_idx=0)

Result after training for 75 epochs

Result