/D2GAN

Double Discriminator GAN

Primary LanguagePython

Implementation of Dual-Discriminator GAN

This is the implementation of the D2GAN(Dual-Discriminator GAN) using pytorch, paper

image

It uses two discriminator. one sees real data as real, however another one sees real data as fake.

According to the paper, loss function is different from ordinary GAN. Therefore, I made custom loss function. It might be unstable(e.g. explode when training, converges into inf/-inf)

Result is sames as below. I used two datasets, STL10 and CIFAR10

fake_samples_epoch_61_600

result from 64x64 STL10, generated by model

fake_samples_epoch_46_200

result from 64x64 CIFAR10, generated by model

In the paper, they used 32x32 size images, so I converted DCGAN's architecture, changing kernel size of Ds and G's first layers to 4.

its result is same as below.

fake_samples_epoch_42_400

result from 32x32 CIFAR10, generated by model

image

result from 32x32 CIFAR10, from the paper

fake_samples_epoch_30_200

result from 32x32 STL10, generated by model

show much better result on 32x32 data. Also converges much faster than ordinary GAN

Usage

On your console/terminal, type

python main.py

TODO

  • revise custom loss(doesn't update its state for long iteration)
  • clamp networks' gradient
  • apply to more datasets
  • argparser