From c6c004c75f3ff7ccc36e0f5e509c99c5bb4f888f Mon Sep 17 00:00:00 2001 From: r7rohan Date: Tue, 28 Jul 2020 16:36:31 +0530 Subject: [PATCH 1/3] Update index.html --- Autoencoder/index.html | 43 ++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/Autoencoder/index.html b/Autoencoder/index.html index 6e84c06..dd3f276 100644 --- a/Autoencoder/index.html +++ b/Autoencoder/index.html @@ -49,25 +49,28 @@ } - +

TensorFlow.js: MNIST Autoencoder

TensorFlow.js: MNIST Autoencoder


- - + +
-

Train a model to autoencode handwritten digits from the MNIST database using the tf.layers - api. -
- This examples lets you train a MNIST Autoencoder using a Fully Connected Neural Network (also known as a DenseNet).

+

+ This examples lets you train a MNIST Autoencoder using a Fully Connected Neural Network (also known as a DenseNet) in written in Tfjs

You can select the structure for the DenseNet and see the performance of the model.
The MNIST dataset is used as training data. +
+
+ Set latent space dimension to 2 for 2d Exploration of the latent space. Otherwise set it high for accurate autoencoding +
+ Visualization scale determines the scale of 2d pane

- - + +

@@ -76,7 +79,7 @@

Trainin
- +
@@ -88,7 +91,7 @@

Trainin

- +
@@ -96,7 +99,7 @@

Trainin

- +
@@ -104,13 +107,13 @@

Trainin

- +

- - + +
@@ -124,11 +127,11 @@

This will show the examples of autoencoder once it its trained




- - + +
-

This is for 2d plot visualization of latent space of autoencoder.
If your latent space dimension is set to 2D

+

This is for 2d plot visualization of latent space of autoencoder.
Drag in the 2d Pane below slowly

- - + + From b2df8ca063d71f07b8425a55d2e6716f9fa9787b Mon Sep 17 00:00:00 2001 From: r7rohan Date: Tue, 28 Jul 2020 16:37:14 +0530 Subject: [PATCH 2/3] Update index.js --- Autoencoder/index.js | 76 +++++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 29 deletions(-) diff --git a/Autoencoder/index.js b/Autoencoder/index.js index 9a03035..0ff60bc 100644 --- a/Autoencoder/index.js +++ b/Autoencoder/index.js @@ -8,52 +8,63 @@ // for arbitrary data though. It's worth a look :) import {IMAGE_H, IMAGE_W, MnistData} from './datas.js'; -// This is a helper class for drawing loss graphs and MNIST images to the -// window. For the purposes of understanding the machine learning bits, you can -// largely ignore it import * as ui from './ui.js'; -function createConvModel(n_layers,n_units,hidden) { - +function createConvModel(n_layers,n_units,hidden) { //resnet-densenet-batchnorm this.latent_dim = Number(hidden); //final dimension of hidden layer this.n_layers = Number(n_layers); //how many hidden layers in encoder and decoder this.n_units = Number(n_units); //output dimension of each layer this.img_shape = [28,28]; this.img_units = this.img_shape[0] * this.img_shape[1]; // build the encoder + var i = tf.input({shape: this.img_shape}); var h = tf.layers.flatten().apply(i); - - for (var j=0; j