• Stars
    star
    996
  • Rank 46,003 (Top 1.0 %)
  • Language
    Jupyter Notebook
  • Created over 5 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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.

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. This is an experimental modification of the original algorithm. For the original algorithm, see here: https://github.com/timsainb/gaia

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

More Repositories

1

noisereduce

Noise reduction in python using spectral gating (speech, bioacoustics, audio, time-domain signals)
Jupyter Notebook
1,447
star
2

Tensorflow-MultiGPU-VAE-GAN

A single jupyter notebook multi gpu VAE-GAN example with latent space algebra and receptive field visualizations.
Jupyter Notebook
441
star
3

python_spectrograms_and_inversion

Spectrograms, MFCCs, and Inversion Demo in a jupyter notebook
Jupyter Notebook
164
star
4

ParametricUMAP_paper

Parametric UMAP embeddings for representation and semisupervised learning. From the paper "Parametric UMAP: learning embeddings with deep neural networks for representation and semi-supervised learning" (Sainburg, McInnes, Gentner, 2020).
Jupyter Notebook
149
star
5

GAIA

Generative Adversarial Interpolative Autoencoder (GAIA) is a Generative Adversarial Network (GAN) made up of Autoencoders (AE) trained explicitly on interpolations to promote convexity and better latent interpolations.
Jupyter Notebook
77
star
6

AVGN

A generative network for animal vocalizations. For dimensionality reduction, sequencing, clustering, corpus-building, and generating novel 'stimulus spaces'. All with notebook examples using freely available datasets.
Jupyter Notebook
69
star
7

avgn_paper

Latent and generative models of animal vocalizations for songbirds, mice, primates, humans, cetaceans, etc.
Jupyter Notebook
42
star
8

tensorflow-2-feature-visualization-notebooks

Feature and class visualization with deep neural networks in tensorflow. Contains deepdream, style transfer, receptive field visualization, convolutional filter visualization, etc.
Jupyter Notebook
26
star
9

vocalization-segmentation

Simple python algorithms for segmenting animal (songbird, mice) vocalizations into notes and syllables using Dynamic Thresholding and Continuity Filtering.
Jupyter Notebook
26
star
10

birdbrain

A library for viewing songbird brain atlases (European starling, Canary, Zebra finch, Pigeon, Mustached bat)
Jupyter Notebook
20
star
11

curriculum_vitae

My Curriculum Vitae, generated in Python via Jinja from JSON fields into HTML. http://timsainburg.com/pages/cv.html
HTML
11
star
12

postdoc_salaries

Jupyter Notebook
5
star
13

automutualinformation

Auto Mutual Information (Sequential Mutual Information) for temporal data.
Jupyter Notebook
3
star
14

neuroethology_paper_2021

for 2021 current opinions paper
Jupyter Notebook
2
star
15

ParallelsBirdsongLanguagePaper

Code for the Paper "Parallels in the sequential organization of birdsong and human speech." Nature Communications (2019)
Jupyter Notebook
2
star
16

graph_research_notes

Graphing my grad school research notes using networkx and sigma.js
Jupyter Notebook
2
star
17

kinectacq

Acquisition from a Kinect rig
Jupyter Notebook
2
star
18

visualize_wordpress_posts

Visualizing Wordpress Posts using D3 forced directed networks
HTML
2
star
19

multicamera_acquisition

Synchronized machine vision acquisition across multiple cameras using an arduino (Supports FLIR and Basler)
Jupyter Notebook
2
star
20

LeabraExample

1
star
21

LongRangeSequentialOrgPaper

Jupyter Notebook
1
star
22

spikesorting-graph-examples

A quick example spikesorting graph to show the spikeinterface team
Jupyter Notebook
1
star
23

example_r_colab_project

Just a tiny example project for running your R code on colab
Jupyter Notebook
1
star
24

kinect_acquisition_template

Python
1
star