All Projects → EmilienDupont → wgan-gp

EmilienDupont / wgan-gp

Licence: MIT license
Pytorch implementation of Wasserstein GANs with Gradient Penalty

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to wgan-gp

chainer-wasserstein-gan
Chainer implementation of the Wesserstein GAN
Stars: ✭ 20 (-87.58%)
Mutual labels:  gan, wasserstein-gan
Improved-Wasserstein-GAN-application-on-MRI-images
Improved Wasserstein GAN (WGAN-GP) application on medical (MRI) images
Stars: ✭ 23 (-85.71%)
Mutual labels:  wasserstein-gan, wgan-gp
TadGAN
Code for the paper "TadGAN: Time Series Anomaly Detection Using Generative Adversarial Networks"
Stars: ✭ 67 (-58.39%)
Mutual labels:  wasserstein-gan, gradient-penalty
progressive growing of GANs
Pure tensorflow implementation of progressive growing of GANs
Stars: ✭ 31 (-80.75%)
Mutual labels:  wasserstein-gan, wgan-gp
Unified Gan Tensorflow
A Tensorflow implementation of GAN, WGAN and WGAN with gradient penalty.
Stars: ✭ 93 (-42.24%)
Mutual labels:  gan, wgan-gp
Mimicry
[CVPR 2020 Workshop] A PyTorch GAN library that reproduces research results for popular GANs.
Stars: ✭ 458 (+184.47%)
Mutual labels:  gan, wgan-gp
Tensorflow Generative Model Collections
Collection of generative models in Tensorflow
Stars: ✭ 3,785 (+2250.93%)
Mutual labels:  gan, wgan-gp
Pytorch Generative Model Collections
Collection of generative models in Pytorch version.
Stars: ✭ 2,296 (+1326.09%)
Mutual labels:  gan, wgan-gp
Awesome Gans
Awesome Generative Adversarial Networks with tensorflow
Stars: ✭ 585 (+263.35%)
Mutual labels:  gan, wgan-gp
Tf.gans Comparison
Implementations of (theoretical) generative adversarial networks and comparison without cherry-picking
Stars: ✭ 477 (+196.27%)
Mutual labels:  gan, wgan-gp
Gan
Resources and Implementations of Generative Adversarial Nets: GAN, DCGAN, WGAN, CGAN, InfoGAN
Stars: ✭ 2,127 (+1221.12%)
Mutual labels:  gan, wasserstein-gan
Gan Tutorial
Simple Implementation of many GAN models with PyTorch.
Stars: ✭ 227 (+40.99%)
Mutual labels:  gan, wgan-gp
Semantic Pyramid for Image Generation
PyTorch reimplementation of the paper: "Semantic Pyramid for Image Generation" [CVPR 2020].
Stars: ✭ 45 (-72.05%)
Mutual labels:  gan
Generative-Model
Repository for implementation of generative models with Tensorflow 1.x
Stars: ✭ 66 (-59.01%)
Mutual labels:  wgan-gp
progressive-growing-of-gans.pytorch
Unofficial PyTorch implementation of "Progressive Growing of GANs for Improved Quality, Stability, and Variation".
Stars: ✭ 51 (-68.32%)
Mutual labels:  wasserstein-gan
sourceseparation misc
No description or website provided.
Stars: ✭ 44 (-72.67%)
Mutual labels:  gan
text2painting
Convert text into beautiful artistic images
Stars: ✭ 55 (-65.84%)
Mutual labels:  gan
speech-enhancement-WGAN
speech enhancement GAN on waveform/log-power-spectrum data using Improved WGAN
Stars: ✭ 35 (-78.26%)
Mutual labels:  wgan-gp
ConvolutionaNeuralNetworksToEnhanceCodedSpeech
In this work we propose two postprocessing approaches applying convolutional neural networks (CNNs) either in the time domain or the cepstral domain to enhance the coded speech without any modification of the codecs. The time domain approach follows an end-to-end fashion, while the cepstral domain approach uses analysis-synthesis with cepstral d…
Stars: ✭ 25 (-84.47%)
Mutual labels:  wasserstein-gan
ZSL-ADA
Code accompanying the paper "A Generative Framework for Zero Shot Learning with Adversarial Domain Adaptation"
Stars: ✭ 18 (-88.82%)
Mutual labels:  gan

Wasserstein GAN with Gradient penalty

Pytorch implementation of Improved Training of Wasserstein GANs by Gulrajani et al.

Examples

MNIST

Parameters used were lr=1e-4, betas=(.9, .99), dim=16, latent_dim=100. Note that the images were resized from (28, 28) to (32, 32).

Training (200 epochs)

mnist_gif

Samples

mnist_samples

Fashion MNIST

Training (200 epochs)

fashion_mnist_gif

Samples

fashion_mnist_samples

LSUN Bedrooms

Gif [work in progress]

Samples [work in progress]

Usage

Set up a generator and discriminator model

from models import Generator, Discriminator
generator = Generator(img_size=(32, 32, 1), latent_dim=100, dim=16)
discriminator = Discriminator(img_size=(32, 32, 1), dim=16)

The generator and discriminator are built to automatically scale with image sizes, so you can easily use images from your own dataset.

Train the generator and discriminator with the WGAN-GP loss

import torch
# Initialize optimizers
G_optimizer = torch.optim.Adam(generator.parameters(), lr=1e-4, betas=(.9, .99))
D_optimizer = torch.optim.Adam(discriminator.parameters(), lr=1e-4, betas=(.9, .99))

# Set up trainer
from training import Trainer
trainer = Trainer(generator, discriminator, G_optimizer, D_optimizer,
                  use_cuda=torch.cuda.is_available())

# Train model for 200 epochs
trainer.train(data_loader, epochs=200, save_training_gif=True)

This will train the models and generate a gif of the training progress.

Note that WGAN-GPs take a long time to converge. Even on MNIST it takes about 50 epochs to start seeing decent results. For more information and a full example on MNIST, check out main.py.

Sources and inspiration

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].