Code Monkey home page Code Monkey logo

pytorch.sngan_projection's Introduction

The original is available at https://github.com/pfnet-research/sngan_projection.

SNGAN and cGANs with projection discriminator

This is unofficial PyTorch implementation of sngan_projection.
This does not reproduce the experiments and results reported in the paper due to the lack of GPUs.
This repository does some experiments on images of size 64x64.

Some results are on issues with results label.

SNGAN

Spectral Normalization for Generative Adversarial Networks
Takeru Miyato, Toshiki Kataoka, Masanori Koyama, Yuichi Yoshida
OpenReview: https://openreview.net/forum?id=B1QRgziT-
arXiv: https://arxiv.org/abs/1802.05957

cGANs with projection discriminator

cGANs with Projection Discriminator
Takeru Miyato, Masanori Koyama
OpenReview: https://openreview.net/forum?id=ByS1VpgRZ
arXiv: https://arxiv.org/abs/1802.05637

Requirements

  • Python 3.6.4
  • PyTorch 0.4.1
  • torchvision 0.2.1
  • NumPy: Used in FID score calculation and data loader
  • SciPy: Used in FID score calculation
  • tensorflow (optional)
  • tensorboardX (optional)
  • tqdm: Progressbar and Log

If you want to use tensorboard for beautiful training update visualization, please install tensorflow and tensorboardX.
When using only tensorboard, tensorflow cpu is enough.

Docker environment

Dockerfiles for pytorch 1.0 environment and tensorboard are added. PyTorch 1.0 Dockerfile requires an nvidia driver that supports CUDA 9.2. Also, this dockerized environment needs some environment variables:

  • DATA: Path to dataset
  • RESULTS: Path to save results
  • PORT: Port number for jupyter notebook.

Dataset

  • tiny ImageNet1.

Tiny Imagenet has 200 classes. Each class has 500 training images, 50 validation images, and 50 test images.

Training configuration

Default parameters are the same as the original Chainer implementation.

  • to train cGAN with projection discriminator: run train_64.py with --cGAN option.
  • to train cGAN with concat discriminator: run train_64.py with both --cGAN and --dis_arch_concat.
  • to run without tensorboard, please add --no_tensorboard.
  • to calculate FID, add --calc_FID (not tested)
  • to use make discriminator relativistic, add --relativistic_loss or -relloss (not tested)

To see all the available arguments, run python train_64.py --help.

TODO

  • implement super-resolution (cGAN)

Acknowledgement

  1. https://github.com/pfnet-research/sngan_projection
  2. https://github.com/mseitzer/pytorch-fid: FID score
  3. https://github.com/naoto0804/pytorch-AdaIN: Infinite Sampler of DataLoader

Footnotes

  1. https://tiny-imagenet.herokuapp.com/ โ†ฉ

pytorch.sngan_projection's People

Contributors

crcrpar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.