All Projects → unit8co → Vegans

unit8co / Vegans

Licence: mit
A library providing various existing GANs in PyTorch.

Projects that are alternatives of or similar to Vegans

Rrpn
Source code of RRPN ---- Arbitrary-Oriented Scene Text Detection via Rotation Proposals
Stars: ✭ 408 (-1.45%)
Mutual labels:  jupyter-notebook
Pycon 2019 Tutorial
Data Science Best Practices with pandas
Stars: ✭ 410 (-0.97%)
Mutual labels:  jupyter-notebook
Handwriting Ocr
OCR software for recognition of handwritten text
Stars: ✭ 411 (-0.72%)
Mutual labels:  jupyter-notebook
Imagenette
A smaller subset of 10 easily classified classes from Imagenet, and a little more French
Stars: ✭ 407 (-1.69%)
Mutual labels:  jupyter-notebook
Python Essentials
Stars: ✭ 411 (-0.72%)
Mutual labels:  jupyter-notebook
Spark Syntax
This is a repo documenting the best practices in PySpark.
Stars: ✭ 412 (-0.48%)
Mutual labels:  jupyter-notebook
Computer Vision
Programming Assignments and Lectures for Stanford's CS 231: Convolutional Neural Networks for Visual Recognition
Stars: ✭ 408 (-1.45%)
Mutual labels:  jupyter-notebook
Datasciencestudynotes
这个仓库保管从(数据科学学习手札69)开始的所有代码、数据等相关附件内容
Stars: ✭ 412 (-0.48%)
Mutual labels:  jupyter-notebook
Tsai
Time series Timeseries Deep Learning Pytorch fastai - State-of-the-art Deep Learning with Time Series and Sequences in Pytorch / fastai
Stars: ✭ 407 (-1.69%)
Mutual labels:  jupyter-notebook
Enterprise gateway
A lightweight, multi-tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across distributed clusters such as Apache Spark, Kubernetes and others.
Stars: ✭ 412 (-0.48%)
Mutual labels:  jupyter-notebook
Jupyters and slides
Stars: ✭ 409 (-1.21%)
Mutual labels:  jupyter-notebook
Pelican Jupyter
Pelican plugin for blogging with Jupyter/IPython Notebooks
Stars: ✭ 410 (-0.97%)
Mutual labels:  jupyter-notebook
Pytorch Original Transformer
My implementation of the original transformer model (Vaswani et al.). I've additionally included the playground.py file for visualizing otherwise seemingly hard concepts. Currently included IWSLT pretrained models.
Stars: ✭ 411 (-0.72%)
Mutual labels:  jupyter-notebook
Colabcat
😺 Running Hashcat on Google Colab with session backup and restore.
Stars: ✭ 407 (-1.69%)
Mutual labels:  jupyter-notebook
Neural Style Audio Tf
TensorFlow implementation for audio neural style.
Stars: ✭ 413 (-0.24%)
Mutual labels:  jupyter-notebook
Your first decentralized application
This is the code for "A Guide to Building Your First Decentralized Application" by Siraj Raval on Youtube
Stars: ✭ 408 (-1.45%)
Mutual labels:  jupyter-notebook
Stat479 Deep Learning Ss19
Course material for STAT 479: Deep Learning (SS 2019) at University Wisconsin-Madison
Stars: ✭ 412 (-0.48%)
Mutual labels:  jupyter-notebook
Qiskit Textbook
A university quantum algorithms/computation course supplement based on Qiskit
Stars: ✭ 404 (-2.42%)
Mutual labels:  jupyter-notebook
Agile data code 2
Code for Agile Data Science 2.0, O'Reilly 2017, Second Edition
Stars: ✭ 413 (-0.24%)
Mutual labels:  jupyter-notebook
Self Driving Cars
Coursera Open Courses from University of Toronto
Stars: ✭ 412 (-0.48%)
Mutual labels:  jupyter-notebook

VeGANs

A library to easily train various existing GANs (Generative Adversarial Networks) in PyTorch.

This library targets mainly GAN users, who want to use existing GAN training techniques with their own generators/discriminators. However researchers may also find the GAN base class useful for quicker implementation of new GAN training techniques.

The focus is on simplicity and providing reasonable defaults.

How to install

You need python 3.5 or above. Then: pip install vegans

How to use

The basic idea is that the user provides discriminator and generator networks, and the library takes care of training them in a selected GAN setting:

from vegans import WGAN
from vegans.utils import plot_losses, plot_image_samples

netD = ### Your discriminator/critic (torch.nn.Module)
netG = ### Your generator (torch.nn.Module)
dataloader = ### Your dataloader (torch.utils.data.DataLoader)

# Build a Wasserstein GAN
gan = WGAN(netG, netD, dataloader, nr_epochs=20)

# train it
gan.train()

# vizualise results
img_list, D_losses, G_losses = gan.get_training_results()
plot_losses(G_losses, D_losses)
plot_image_samples(img_list, 50)

You can currently use the following GANs:

Slightly More Details:

All of these GAN objects inherit from a GAN base class. When building any such GAN, you must give in argument a generator and discriminator networks (some torch.nn.Module), as well as a torch.utils.data.DataLoader. In addition, you can specify some parameters supported by all GAN implementations:

  • optimizer_D and optimizer_G: some PyTorch optimizers (from torch.optim) for the discriminator and generator networks. By defaults those are set with default optimization parameters suggested in the original papers.
  • nr_epochs: the number of epochs (default: 5)
  • nz: size of the noise vector (input of the generator) - by default nz=100.
  • save_every: VeGANs will store some samples produced by the generator every save_every iteration. Default: 500
  • fixed_noise_size: The number of samples to save (from fixed noise vectors)
  • print_every: The number of iterations between printing training progress. Default: 50

Finally, when calling train() you can specify some parameters specific to each GAN. For example, for the Wasserstein GAN we can do:

gan = WGAN(netG, netD, dataloader)
gan.train(clip_value=0.1)

This will train a Wasserstein GAN with clipping values of 0.1 (instead of the default 0.01).

If you are researching new GAN training algorithms, you may find it useful to inherit from the GAN base class.

Learn more:

Currently the best way to learn more about how to use VeGANs is to have a look at the example notebooks. You can start with this simple example showing how to sample from a univariate Gaussian using a GAN. Alternatively, can run example scripts.

Contribute

PRs and suggestions are welcome. Look here for more details on the setup.

Credits

Some of the code has been inspired by some existing GAN implementations:

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].