Giter Site home page Giter Site logo

anindya-prithvi / mnist_caelatentspace Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7.08 MB

Convolutional AutoEncoders (MNIST) and their generative capabilities (kind of amazing)

Home Page: https://anindya-prithvi.github.io/MNIST_CAELatentSpace/

Jupyter Notebook 98.15% Python 0.40% HTML 0.37% JavaScript 1.08%
autoencoder-mnist linear-discriminant-analysis machine-learning mnist plt python onnx onnxruntime onnxruntime-web

mnist_caelatentspace's Introduction

Objective

Observe the Latent space of Convolutional AutoEncoder for a classification dataset (MNIST)

Architecture of Auto Encoder

The encoder consists of multiple convolutions and batchnormalizations only. We scale a 28x28 to 7x1 vector.
The decoder is again transposed convolutions and batchnormalizations, i.e. 7x1 to 28x28.
Optimizers/LR/decays used have not been hyperparameter optimized yet. Therefore the current loss is 0.02 for 50 epochs.
CAE Output

To Observable

We encode the training images to our latent space as usual. However we then apply LDA transformations with n_components=2. Plotting the transformed data we could observe well formed clusters (refer notebook). Also, there were obviously some overlapping ones, to resolve them, a 3D LDA transformation was obtained. The clusters were amazingly distinguishable with almost 0 overlap.

2D LDA result.

2D LDA result

3D LDA plot © Aflah

3D LDA result - Interactive (Click)
image

Observations

  1. We can generate multiple fake samples given the latent space encoding distributed on multivariate gaussian distribution with parameters from MLE estimates of the training data (of a specific class) in latent space.
  2. Latent space was initally made keeping in mind a 7-segment decoder. But guess what (HINT: Look at the means)
  3. All of the following is synthetic data
    synthesis
    array([
        3, 2, 2, 2, 7, 6, 6, 2, 2, 2, 2, 1, 2, 6, 2, 2, 
        2, 2, 6, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 1, 2, 
        8, 2, 2, 2, 2, 6, 2, 2, 6, 0, 7, 2, 0, 2, 2, 9, 
        5, 2, 2, 2, 5, 2, 2, 2, 6, 6, 2, 2, 2, 2, 2, 2, 
        2, 2, 2, 2, 4, 8, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 
        6, 2, 8, 2, 2, 2, 6, 2, 2, 2, 2, 2, 2, 8, 3, 2, 
        2, 2, 6, 2, 8, 2, 2, 2, 2, 2, 2, 5, 2, 2, 2, 2, 
        2, 6, 2, 2, 2, 2, 2, 2, 2, 8, 2, 6, 8, 2, 2, 2], dtype=int64)
  4. A demo is now live at ghpages. Drag the sliders to move around the Latent space.

mnist_caelatentspace's People

Contributors

anindya-prithvi avatar

Watchers

 avatar

mnist_caelatentspace's Issues

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.