All Projects → grohith327 → simplegan

grohith327 / simplegan

Licence: MIT license
Tensorflow-based framework to ease training of generative models

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to simplegan

Gesturegan
[ACM MM 2018 Oral] GestureGAN for Hand Gesture-to-Gesture Translation in the Wild
Stars: ✭ 136 (+615.79%)
Mutual labels:  generative-adversarial-network, generative-model
pytorch-GAN
My pytorch implementation for GAN
Stars: ✭ 12 (-36.84%)
Mutual labels:  generative-adversarial-network, generative-model
Semantic image inpainting
Semantic Image Inpainting
Stars: ✭ 140 (+636.84%)
Mutual labels:  generative-adversarial-network, generative-model
Spectralnormalizationkeras
Spectral Normalization for Keras Dense and Convolution Layers
Stars: ✭ 100 (+426.32%)
Mutual labels:  generative-adversarial-network, generative-model
coursera-gan-specialization
Programming assignments and quizzes from all courses within the GANs specialization offered by deeplearning.ai
Stars: ✭ 277 (+1357.89%)
Mutual labels:  generative-adversarial-network, generative-model
Generative Evaluation Prdc
Code base for the precision, recall, density, and coverage metrics for generative models. ICML 2020.
Stars: ✭ 117 (+515.79%)
Mutual labels:  generative-adversarial-network, generative-model
Stylegan2 Pytorch
Simplest working implementation of Stylegan2, state of the art generative adversarial network, in Pytorch. Enabling everyone to experience disentanglement
Stars: ✭ 2,656 (+13878.95%)
Mutual labels:  generative-adversarial-network, generative-model
Mnist inception score
Training a MNIST classifier, and use it to compute inception score (ICP)
Stars: ✭ 25 (+31.58%)
Mutual labels:  generative-adversarial-network, generative-model
Triple Gan
See Triple-GAN-V2 in PyTorch: https://github.com/taufikxu/Triple-GAN
Stars: ✭ 203 (+968.42%)
Mutual labels:  generative-adversarial-network, generative-model
Neuralnetworks.thought Experiments
Observations and notes to understand the workings of neural network models and other thought experiments using Tensorflow
Stars: ✭ 199 (+947.37%)
Mutual labels:  generative-adversarial-network, generative-model
Lggan
[CVPR 2020] Local Class-Specific and Global Image-Level Generative Adversarial Networks for Semantic-Guided Scene Generation
Stars: ✭ 97 (+410.53%)
Mutual labels:  generative-adversarial-network, generative-model
Sgan
Stacked Generative Adversarial Networks
Stars: ✭ 240 (+1163.16%)
Mutual labels:  generative-adversarial-network, generative-model
Markov Chain Gan
Code for "Generative Adversarial Training for Markov Chains" (ICLR 2017 Workshop)
Stars: ✭ 76 (+300%)
Mutual labels:  generative-adversarial-network, generative-model
Cramer Gan
Tensorflow Implementation on "The Cramer Distance as a Solution to Biased Wasserstein Gradients" (https://arxiv.org/pdf/1705.10743.pdf)
Stars: ✭ 123 (+547.37%)
Mutual labels:  generative-adversarial-network, generative-model
Conditional Animegan
Conditional GAN for Anime face generation.
Stars: ✭ 70 (+268.42%)
Mutual labels:  generative-adversarial-network, generative-model
Conditional Gan
Anime Generation
Stars: ✭ 141 (+642.11%)
Mutual labels:  generative-adversarial-network, generative-model
Seqgan
A simplified PyTorch implementation of "SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient." (Yu, Lantao, et al.)
Stars: ✭ 502 (+2542.11%)
Mutual labels:  generative-adversarial-network, generative-model
Cadgan
ICML 2019. Turn a pre-trained GAN model into a content-addressable model without retraining.
Stars: ✭ 19 (+0%)
Mutual labels:  generative-adversarial-network, generative-model
Dragan
A stable algorithm for GAN training
Stars: ✭ 189 (+894.74%)
Mutual labels:  generative-adversarial-network, generative-model
Wgan
Tensorflow Implementation of Wasserstein GAN (and Improved version in wgan_v2)
Stars: ✭ 228 (+1100%)
Mutual labels:  generative-adversarial-network, generative-model

SimpleGAN

License Documentation Status Downloads Downloads Code style: black

Framework to ease training of generative models

SimpleGAN is a framework based on TensorFlow to make training of generative models easier. SimpleGAN provides high level APIs with customizability options to user which allows them to train a generative models with few lines of code or the user can reuse modules from the exisiting architectures to run custom training loops and experiments.

Requirements

Make sure you have the following packages installed

Installation

Latest stable release:

  $ pip install simplegan

Latest Development release:

  $ pip install git+https://github.com/grohith327/simplegan.git

Getting Started

DCGAN
from simplegan.gan import DCGAN

## initialize model
gan = DCGAN()

## load train data
train_ds = gan.load_data(use_mnist = True)

## get samples from the data object
samples = gan.get_sample(train_ds, n_samples = 5)

## train the model
gan.fit(train_ds = train_ds)

## get generated samples from model
generated_samples = gan.generate_samples(n_samples = 5)
Custom training loops for GANs
from simplegan.gan import Pix2Pix

## initialize model
gan = Pix2Pix()

## get generator module of Pix2Pix
generator = gan.generator() ## A tf.keras model

## get discriminator module of Pix2Pix
discriminator = gan.discriminator() ## A tf.keras model

## training loop
with tf.GradientTape() as tape:
""" Custom training loops """
Convolutional Autoencoder
from simplegan.autoencoder import ConvolutionalAutoencoder

## initialize autoencoder
autoenc = ConvolutionalAutoencoder()

## load train and test data
train_ds, test_ds = autoenc.load_data(use_cifar10 = True)

## get sample from data object
train_sample = autoenc.get_sample(data = train_ds, n_samples = 5)
test_sample = autoenc.get_sample(data = test_ds, n_samples = 1)

## train the autoencoder
autoenc.fit(train_ds = train_ds, epochs = 5, optimizer = 'RMSprop', learning_rate = 0.002)

## get generated test samples from model
generated_samples = autoenc.generate_samples(test_ds = test_ds.take(1))

To have a look at more examples in detail, check here

Documentation

Check out the docs page

Provided models

Model Generated Images
Vanilla Autoencoder None
Convolutional Autoencoder
Variational Autoencoder [Paper]
Vector Quantized - Variational Autoencoder [Paper]
Vanilla GAN [Paper]
DCGAN [Paper]
WGAN [Paper]
CGAN [Paper]
InfoGAN [Paper]
Pix2Pix [Paper]
CycleGAN [Paper]
3DGAN(VoxelGAN) [Paper]
Self-Attention GAN(SAGAN) [Paper]

Contributing

We appreciate all contributions. If you are planning to perform bug-fixes, add new features or models, please file an issue and discuss before making a pull request.

Citation

@software{simplegan,
    author = {{Rohith Gandhi et al.}},
    title = {simplegan},
    url = {https://simplegan.readthedocs.io},
    version = {0.2.9},
}

Contributors

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