All Projects → codekansas → Gandlf

codekansas / Gandlf

Licence: mit
Generative Adversarial Networks in Keras

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Gandlf

Tensorflow Srgan
Tensorflow implementation of "Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network" (Ledig et al. 2017)
Stars: ✭ 33 (-28.26%)
Mutual labels:  gan, generative-adversarial-network
Gans In Action
Companion repository to GANs in Action: Deep learning with Generative Adversarial Networks
Stars: ✭ 748 (+1526.09%)
Mutual labels:  gan, generative-adversarial-network
Adversarial video generation
A TensorFlow Implementation of "Deep Multi-Scale Video Prediction Beyond Mean Square Error" by Mathieu, Couprie & LeCun.
Stars: ✭ 662 (+1339.13%)
Mutual labels:  gan, generative-adversarial-network
All About The Gan
All About the GANs(Generative Adversarial Networks) - Summarized lists for GAN
Stars: ✭ 630 (+1269.57%)
Mutual labels:  gan, generative-adversarial-network
Musegan
An AI for Music Generation
Stars: ✭ 794 (+1626.09%)
Mutual labels:  gan, generative-adversarial-network
Ad examples
A collection of anomaly detection methods (iid/point-based, graph and time series) including active learning for anomaly detection/discovery, bayesian rule-mining, description for diversity/explanation/interpretability. Analysis of incorporating label feedback with ensemble and tree-based detectors. Includes adversarial attacks with Graph Convolutional Network.
Stars: ✭ 641 (+1293.48%)
Mutual labels:  gan, generative-adversarial-network
Context Encoder
[CVPR 2016] Unsupervised Feature Learning by Image Inpainting using GANs
Stars: ✭ 731 (+1489.13%)
Mutual labels:  gan, generative-adversarial-network
Awesome Gans
Awesome Generative Adversarial Networks with tensorflow
Stars: ✭ 585 (+1171.74%)
Mutual labels:  gan, generative-adversarial-network
Pytorch Pretrained Biggan
🦋A PyTorch implementation of BigGAN with pretrained weights and conversion scripts.
Stars: ✭ 779 (+1593.48%)
Mutual labels:  gan, generative-adversarial-network
Instagan
InstaGAN: Instance-aware Image Translation (ICLR 2019)
Stars: ✭ 761 (+1554.35%)
Mutual labels:  gan, generative-adversarial-network
Exposure
Learning infinite-resolution image processing with GAN and RL from unpaired image datasets, using a differentiable photo editing model.
Stars: ✭ 605 (+1215.22%)
Mutual labels:  gan, generative-adversarial-network
Relativistic Average Gan Keras
The implementation of Relativistic average GAN with Keras
Stars: ✭ 36 (-21.74%)
Mutual labels:  gan, generative-adversarial-network
Cartoongan Tensorflow
Generate your own cartoon-style images with CartoonGAN (CVPR 2018), powered by TensorFlow 2.0 Alpha.
Stars: ✭ 587 (+1176.09%)
Mutual labels:  gan, generative-adversarial-network
Pggan Pytorch
🔥🔥 PyTorch implementation of "Progressive growing of GANs (PGGAN)" 🔥🔥
Stars: ✭ 653 (+1319.57%)
Mutual labels:  gan, generative-adversarial-network
Pix2pixhd
Synthesizing and manipulating 2048x1024 images with conditional GANs
Stars: ✭ 5,553 (+11971.74%)
Mutual labels:  gan, generative-adversarial-network
Fewshot Face Translation Gan
Generative adversarial networks integrating modules from FUNIT and SPADE for face-swapping.
Stars: ✭ 705 (+1432.61%)
Mutual labels:  gan, generative-adversarial-network
Generative Adversarial Networks
Introduction to generative adversarial networks, with code to accompany the O'Reilly tutorial on GANs
Stars: ✭ 505 (+997.83%)
Mutual labels:  gan, generative-adversarial-network
Hidt
Official repository for the paper "High-Resolution Daytime Translation Without Domain Labels" (CVPR2020, Oral)
Stars: ✭ 513 (+1015.22%)
Mutual labels:  gan, generative-adversarial-network
Anime Inpainting
An application tool of edge-connect, which can do anime inpainting and drawing. 动漫人物图片自动修复,去马赛克,填补,去瑕疵
Stars: ✭ 761 (+1554.35%)
Mutual labels:  gan, generative-adversarial-network
St Cgan
Dataset and Code for our CVPR'18 paper ST-CGAN: "Stacked Conditional Generative Adversarial Networks for Jointly Learning Shadow Detection and Shadow Removal"
Stars: ✭ 13 (-71.74%)
Mutual labels:  gan, generative-adversarial-network

Generative Adversarial Network Deep Learning Framework

Home is now behind you, the world is ahead!

This framework was built to make it possible for anyone to train Generative Adversarial Networks. It is built on top of Keras.

Because it's built on top of Keras, it has the benefits of being modular, minimal and extensible, running on both CPU and GPU using either Tensorflow or Theano.

Installation

Installing PyPi version:

pip install gandlf

Installing up-to-date version:

pip install git+https://github.com/codekansas/gandlf
pip install h5py  # To save and load Keras models

Installing from source:

git clone https://github.com/codekansas/gandlf
cd gandlf
pip install -r requirements.txt
python setup.py install

Quick Start

Below demonstrates how a Gandlf model works.

import keras
import gandlf

def build_generator():
    latent_vec = keras.layers.Input(shape=..., name='latent_vec')
    output_layer = keras.layers.Dense(...)(latent_vec)
    return keras.models.Model(input=[latent_vec], output=[output_layer])

def build_discriminator():
    data_input = keras.layers.Input(shape=..., name='data_input')
    output_layer = keras.layers.Dense(..., name='src')(data_input)
    return keras.models.Model(input=[data_input], output=[output_layer])

model = gandlf.Model(generator=build_generator(),
                     discriminator=build_discriminator())

model.compile(optimizer='adam', loss='binary_crossentropy')

# Latent vector is fed data from a random normal distribution.
# <input_data> represents the real data.
# 'zeros' and 'ones' represent 'fake' and 'real', respectively.
# In this case, the discriminator learns 'real data' -> 1
# and fake 'generated data' -> 0, while the generator learns
# 'generated data' -> 1.
model.fit(['normal', <input_data>], ['ones', 'zeros'])

# There are many ways to do the same thing, depending on the level
# of specificity you need (especially when training with auxiliary parts).
# The above function could be written as any of the following:
model.fit(['normal', <input_data>], {'gen_real': 'ones', 'fake': 'zeros'})
model.fit({'latent_vec': 'normal', 'data_input': <input_data>},
          {'src': 'ones', 'src_fake': 'zeros'})
model.fit({'latent_vec': 'normal', 'data_input': <input_data>},
          {'src_gen': '1', 'src_real': '1', 'src_fake': '0'})

# The model provides a function for predicting the discriminator's
# output on some input data, which is useful for auxiliary classification.
model_predictions = model.predict([<input_data>])

# The model also provides a function for sampling from the generator.
generated_data = model.sample(['normal'], num_samples=10)

# Under the hood, other functions work like their Keras counterparts.
model.save('/save/path')
model.generator.save('/generator/save/path')
model.discriminator.save('/discriminator/save/path')

Guiding Principles

In no particular order:

  • Keras-esque: The APIs should feel familiar for Keras users, with some minor changes.
  • Powerful: Models should support a wide variety of GAN architectures.
  • Extensible: Models should be easy to modify for different experiments.

Issues Etiquette

More examples would be awesome! If you use this for something, create a stand-alone script that can be run and I'll put it in the examples directory. Just create a pull request for it.

Contribute code too! Anything that might be interesting and relevant for building GANs. Since this is more task-specific than Keras, there is more room for more experimental layers and ideas (notice that "dependability" isn't one of the guiding principles, although it would be good to not have a huge nest of bugs).

If you encounter an error, I would really like to hear about it! But please raise an issue before creating a pull request, to discuss the error. Even better, look around the code to see if you can spot what's going wrong. Try to practice good etiquette, not just for this project, but for open source projects in general; this means making an honest attempt at solving the problem before asking for help.

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