easy wrapper for initializing several GAN networks in keras
Project description
Simple GAN
This is my attempt to make a wrapper class for a GAN in keras which can be used to abstract the whole architecture process.
Overview
Flow Chart
Setting up a Generative Adversarial Network involves having a discriminator and a generator working in tandem, with the ultimate goal being that the generator can come up with samples that are indistinguishable from valid samples by the discriminator.
Installation
pip install adversarials
Example
import numpy as np
from keras.datasets import mnist
from adversarials.core import Log
from adversarials import SimpleGAN
if __name__ == '__main__':
(X_train, _), (_, _) = mnist.load_data()
# Rescale -1 to 1
X_train = (X_train.astype(np.float32) - 127.5) / 127.5
X_train = np.expand_dims(X_train, axis=3)
Log.info('X_train.shape = {}'.format(X_train.shape))
gan = SimpleGAN(save_to_dir="./assets/images",
save_interval=20)
gan.train(X_train, epochs=40)
Credits
- Understanding Generative Adversarial Networks - Noaki Shibuya
- Github Keras Gan
- Simple gan
Contribution
You are very welcome to modify and use them in your own projects.
Please keep a link to the original repository. If you have made a fork with substantial modifications that you feel may be useful, then please open a new issue on GitHub with a link and short description.
License (MIT)
This project is opened under the MIT 2.0 License which allows very broad use for both academic and commercial purposes.
A few of the images used for demonstration purposes may be under copyright. These images are included under the "fair usage" laws.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Adversarials-1.0.1.tar.gz
.
File metadata
- Download URL: Adversarials-1.0.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c18012f5a1e458f9675ef69ab0df89c6fa625f837ef7beca0aa8981cf8a350d9 |
|
MD5 | dc144ac8b3405147c8a3bec66adaa7ec |
|
BLAKE2b-256 | b597e8a2248a23c0c08176a57693eb5646cc869c652b8b90089a9ef620b63f91 |
File details
Details for the file Adversarials-1.0.1-py3.6.egg
.
File metadata
- Download URL: Adversarials-1.0.1-py3.6.egg
- Upload date:
- Size: 28.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b30961614808e3f7c8783c90d5e1ec1a541945d729d3cc2db7af20707e1fb31 |
|
MD5 | e88588b10bce2cc3e3eec41e221f7f15 |
|
BLAKE2b-256 | 122bd6efadb7e2a7025231ddda581b917dc49de1ec93e78bab4f589fcd0e0554 |