Coder Social home page Coder Social logo

bruinxiong / tensorflow2-generative-models Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timsainb/tensorflow2-generative-models

0.0 2.0 0.0 17.38 MB

Implementations of a number of generative models in Tensorflow 2. GAN, VAE, Seq2Seq, VAEGAN, GAIA, Spectrogram Inversion. Everything is self contained in a jupyter notebook for easy export to colab.

Jupyter Notebook 100.00%

tensorflow2-generative-models's Introduction

Binder

Generative models in Tensorflow 2

Tim Sainburg (PhD Candidate, UCSD, Gentner Laboratory)

This is a small project to implement a number of generative models in Tensorflow 2. Layers and optimizers use Keras. The models are implemented for two datasets: fashion MNIST, and NSYNTH. Networks were written with the goal of being as simple and consistent as possible while still being readable. Because each network is self contained within the notebook, they should be easily run in a colab session.

Included models:

Autoencoder (AE) Open In Colab

A simple autoencoder network.

an autoencoder

Variational Autoencoder (VAE) (article) Open In Colab

The original variational autoencoder network, using tensorflow_probability

variational autoencoder

Generative Adversarial Network (GAN) (article) Open In Colab

GANs are a form of neural network in which two sub-networks (the encoder and decoder) are trained on opposing loss functions: an encoder that is trained to produce data which is indiscernable from the true data, and a decoder that is trained to discriminate between the data and generated data.

gan

Wasserstein GAN with Gradient Penalty (WGAN-GP) (article) Open In Colab

WGAN-GP is a GAN that improves over the original loss function to improve training stability.

wgan gp

VAE-GAN (article) Open In Colab

VAE-GAN combines the VAE and GAN to autoencode over a latent representation of data in the generator to improve over the pixelwise error function used in autoencoders.

vae gan

Generative adversarial interpolative autoencoder (GAIA) (article) Open In Colab

GAIA is an autoencoder trained to learn convex latent representations by adversarially training on interpolations in latent space projections of real data.

generative adversarial interpolative autoencoding network

Other Notebooks:

Seq2Seq Autoencoder (without attention) (Fasion MNIST: Open In Colab | NSYNTH: Open In Colab)

Seq2Seq models use recurrent neural network cells (like LSTMs) to better capture sequential organization in data. This implementation uses Convolutional Layers as input to the LSTM cells, and a single Bidirectional LSTM layer.

a seq2seq bidirectional lstm in tensorflow 2.0

Spectrogramming, Mel Scaling, MFCCs, and Inversion in Tensorflow Open In Colab

Tensorflow has a signal processing package that allows us to generate spectrograms from waveforms as part of our dataset iterator, rather than pregenerating a second spectrogram dataset. This notebook can serve as a reference for how this is done. Spectrogram inversion is done using the Griffin-Lim algorithm.

spectrogram inversion in tensorflow 2.0

Iterator for NSynth Open In Colab

The NSYNTH dataset is a set of thousands of musical notes saved as waveforms. To input these into a Seq2Seq model as spectrograms, I wrote a small dataset class that converts to spectrogram in tensorflow (using the code from the spectrogramming notebook).

a dataset iterator for tensorflow 2.0

tensorflow2-generative-models's People

Contributors

timsainb avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.