opennng

OpenNNG is a toolkit that offers an easy interface to generative models.


Keywords
generative-models tensorflow generative-adversarial-network gan variational-autoencoder vae, gan, generative-adversarial-network, generative-models, tensorflow, variational-autoencoder
License
MIT
Install
pip install opennng==0.1.8

Documentation

OpenGen (Work in progress...)

OpenGen is a general purpose data generator toolkit that uses TensorFlow 2.0. Supported architectures:

To install it

Key features

OpenGen focuses on modularity to support advanced modeling and training capabilities:

  • usage of predefined models
  • creation of custom architectures
  • domain adaptation

Installation

Clone repository

If you want to use OpenGen as a command line interface where the processes of training, evaluating etc. are all automated, run the following commands:

git clone https://github.com/avramandrei/OpenGen.git
pip install -r requirements.txt

pip

If you want to use OpenGen as an API and have more flexibility, install it via pip:

pip install opengen-tf

Usage

OpenGen requires:

  • Python >= 3.6
  • TensorFlow >= 2.0
  • Pillow >=6.1

Data processing

Data must be saved in Numpy .npy files. In this example we will use the mnist dataset to generate new images. For this purpose, use the download.py script with mnist as argument. This command will automatically download mnist (raw and processed) dataset in data/ directory.

python3 download.py mnist

Configuration

To train and generate new samples, a YAML configuration file must be provided. Here is an exhaustive list of all the configuration parameters.

Train

To train, run train.py with a YAML configuration file as parameter.

python3 train.py <path_to_yaml_config_file>

This script will automatically generate 10 samples that shows how the training process evolves at evrey checkpoint. To disable this functionality, set generate_train_samples to False in YAML configuration file.

Model Samples
ConvVAESmall alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text
ConvGANSmall alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text

Generate

To generate a new sample, run generate.py with a YAML configuration file as parameter.

python3 generate.py <path_to_yaml_config_file>