Skip to content

Latest commit

 

History

History

VAE1D

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

1D Variational Autoencoder

This is an example of a simple 1-dimensional Variational Autoencoder model, using MNIST as a training dataset. Variational Autoencoder is based on the paper: "Auto-Encoding Variational Bayes", Kingma et. al. It should produce output similar to the following:

Epoch 1

Epoch 10

Setup

To begin, you'll need the latest version of Swift for TensorFlow installed. Make sure you've added the correct version of swift to your path.

To train the model, run:

swift run -c release VariationalAutoencoder1D

Key implementations

  1. Reparamterization trick is internally implemented in the VAE model
  2. VAE model returns an Array of Tensor<Float> tensors - which is inherently a Differentiable extension. (Reference: S4TF API Docs)
  3. Loss Function combines sigmoidCrossEntropy of the output and KL Divergence between the intermediate representations.