krayush07 / autoencoder

Autoencoder and visualization for MNIST

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repository contains code for feature dimensionality reduction using autoencoder. The repository will be updated with other methods to encode the input as well as code to train autoencoder on textual dataset.


Requirements

  • Python 2.7
  • Tensorflow 1.2.1
  • Numpy

Project Module

  • utility_dir: storage module for data, vocab files, saved models, tensorboard logs, outputs.

  • implementation_module: code for model architecture, data reader, training pipeline and test pipeline.

  • settings_module: code to set directory paths (data path, vocab path, model path etc.), set model parameters (hidden dim, attention dim, regularization, dropout etc.), set vocab dictionary.

  • run_module: wrapper code to execute end-to-end train and test pipeline.

  • visualization_module: code to generate embedding visualization via tensorboard.

  • utility_code: other utility codes


How to run

  • train: python -m global_module.run_module.run_train

  • test: python -m global_module.run_module.run_test

  • visualize tensorboard: tensorboard --logdir=PATH-TO-LOG-DIR

  • visualize embeddings: tensorboard --logdir=PATH-TO-LOG-DIR/EMB_VIZ


How to change model parameters

Go to set_params.py here.


Loss and Accuracy Plots

alt text

alt text



Autoencoder Visualization

Decoded and corresponding input image of training set at different steps:

alt text

alt text

alt text

alt text

alt text


Decoded and corresponding input image of valid set:

alt text


Decoded and corresponding input image of test set:

alt text



Latent Representation

t-SNE representation of latent features of images in test set

alt text


Visualization of points corresponding to latent feature of image '1' in test set in t-SNE representation alt text


Visualization of points corresponding to latent feature of image '5' in test set in t-SNE representation alt text

About

Autoencoder and visualization for MNIST


Languages

Language:Python 100.0%