tree: d600db8f7ee1b2f226dcb5135957b090c36b883e
  1. __init__.py
  2. dcgan.py
  3. inception_score.py
  4. README.md
example/gluon/dc_gan/README.md

DCGAN in MXNet

Deep Convolutional Generative Adversarial Networks(DCGAN) implementation with Apache MXNet GLUON. This implementation uses inception_score to evaluate the model.

You can use this reference implementation on the MNIST and CIFAR-10 datasets.

Generated image output examples from the CIFAR-10 dataset

Generated image output examples from the CIFAR-10 dataset

Generated image output examples from the MNIST dataset

Generated image output examples from the MNIST dataset

inception_score in cpu and gpu (the real image`s score is around 3.3)

CPU & GPU

inception score with CPU inception score with GPU

Quick start

Use the following code to see the configurations you can set:

python dcgan.py -h
optional arguments:
  -h, --help            show this help message and exit
  --dataset DATASET     dataset to use. options are cifar10 and mnist.
  --batch-size BATCH_SIZE  input batch size, default is 64
  --nz NZ               size of the latent z vector, default is 100
  --ngf NGF             the channel of each generator filter layer, default is 64.
  --ndf NDF             the channel of each descriminator filter layer, default is 64.
  --nepoch NEPOCH       number of epochs to train for, default is 25.
  --niter NITER         save generated images and inception_score per niter iters, default is 100.
  --lr LR               learning rate, default=0.0002
  --beta1 BETA1         beta1 for adam. default=0.5
  --cuda                enables cuda
  --netG NETG           path to netG (to continue training)
  --netD NETD           path to netD (to continue training)
  --outf OUTF           folder to output images and model checkpoints
  --check-point CHECK_POINT
                        save results at each epoch or not
  --inception_score INCEPTION_SCORE
                        To record the inception_score, default is True.

Use the following Python script to train a DCGAN model with default configurations using the CIFAR-10 dataset and record metrics with inception_score:

python dcgan.py