Skip to content

LegendTianjin/rocgan

 
 

Repository files navigation

Robust Conditional GAN

Chainer implementation of the ICLR paper "Robust Conditional Generative Adversarial Networks"

https://openreview.net/forum?id=Byg0DsCqYQ1

Robust Conditional GANs aim at leveraging structure in the target space of the generator by augmenting it with a new, unsupervised pathway to learn the target structure.

Testing/demo mode

We provide a jupyter notebook that illustrates how to call the code for testing.

If you want to use the pretrained models, please follow the instructions in the notebook. The demo testing images are provided in the demo/ folder.

Train the network

To train the network, e.g. with rocgan, you can execute the following command:

python jobs/rocgan/train_mn.py '--config jobs/rocgan/iclr_5layer_rocgan_super.yml' 

The yml file describes the modules/dataset to train on. The hyper-parameters are included in the yml, no need to hardcode them in the files.

Dataset preparation

The code is tuned for super-resolution (or any task that requires a pair of input/output images).

In each iteration, a single file is loaded from disk; this file is the vertical concatenation of the input and the output images. Please see the demo/ folder for some samples; the idea is to vertically concatenate the images with the input (e.g. corrupted) image on top and the output image on the bottom. All images are resized to 64x64 for training/testing.

Misc

The results are improved over the original ICLR publication; those results and pretrained files correspond to the journal version of the code (currently under review).

Tested on a Linux machine with:

  • chainer=4.0.0, chainercv=0.9.0,
  • chainer=5.2.0, chainercv=0.12.0.

The code is highly influenced by2.

Apart from Chainer, the code depends on Pyaml3.

Citing

If you use this code, please cite4:

BibTeX:

@inproceedings{
chrysos2018rocgan,
title={Robust Conditional Generative Adversarial Networks},
author={Grigorios G. Chrysos and Jean Kossaifi and Stefanos Zafeiriou},
booktitle={International Conference on Learning Representations (ICLR)},
year={2019},
url={https://openreview.net/forum?id=Byg0DsCqYQ},
}

References


  1. Grigorios G. Chrysos, Jean Kossaifi and Stefanos Zafeiriou, Robust Conditional Generative Adversarial Networks, International Conference on Learning Representations (ICLR), 2019.

  2. https://github.com/pfnet-research/sngan_projection

  3. https://pypi.org/project/pyaml/

  4. Grigorios G. Chrysos, Jean Kossaifi and Stefanos Zafeiriou, Robust Conditional Generative Adversarial Networks, International Conference on Learning Representations (ICLR), 2019.

About

Chainer implementation of the paper Robust Conditional Generative Adversarial Networks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.4%
  • Jupyter Notebook 2.6%