Skip to main content

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.

Build Status

Overview

alt text

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.

alt text

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Adversarials-1.0.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

Adversarials-1.0.1-py3.6.egg (28.4 kB view details)

Uploaded Source

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

Hashes for Adversarials-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c18012f5a1e458f9675ef69ab0df89c6fa625f837ef7beca0aa8981cf8a350d9
MD5 dc144ac8b3405147c8a3bec66adaa7ec
BLAKE2b-256 b597e8a2248a23c0c08176a57693eb5646cc869c652b8b90089a9ef620b63f91

See more details on using hashes here.

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

Hashes for Adversarials-1.0.1-py3.6.egg
Algorithm Hash digest
SHA256 5b30961614808e3f7c8783c90d5e1ec1a541945d729d3cc2db7af20707e1fb31
MD5 e88588b10bce2cc3e3eec41e221f7f15
BLAKE2b-256 122bd6efadb7e2a7025231ddda581b917dc49de1ec93e78bab4f589fcd0e0554

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page