Go to content ALT+c

Neural Network Programming  (Apr. 2018) (Old site; new site is at https://scinet.courses)
Registration is closed

Friday May 31, 2024 - 05:07

3.3 Assignment 3

Due date: Thursday, May 31th at midnight

 Consider the image on slide 10 of variational autoencoders class (lecture 11):

 

 


Recall how this image was produced:

  • A standard autoencoder network was created, to operate on the MNIST data set.
  • The encoder part of the autoencoder was designed to output a latent vector with a size of 2.  Allowing the vectors to be plotted on a 2D graph.
  • The network was trained on the MNIST training data.
  • The MNIST test data was then sent through the encoder part of the network, and the resulting vectors plotted on the graph.  The digit associated with the particular data point determined the colour of the dot which was plotted.

The purpose of this assignment is to reproduce this plot.

 

Create two Python scripts, called "mnist_ae.py",  and "plot_encodings.py".  The first script should perform the following steps:

  • read in the MNIST data set,
  • build an autoencoding neural network, using Keras, to be trained on the MNIST training data.  The network should be built as a combination of an 'encoding' network, and a 'decoding' network, rather than as a single network.  The output of the encoding part of the network should have a dimension of 2, so that it can be plotted.
  • train the network on the training data,
  • save the 'encoding' and 'decoding' networks to file.

The second script should perform the following steps:

  • read in the MNIST data set,
  • read in the previously-trained-and-saved encoding part of autoencoding network.
  • pass the MNIST test data through the encoding network.
  • scatter plot the 2D output, colour-coding the dots by the value of the digit.
  • save the image as a pdf file.

 

Your script will be tested from the Linux command line, thus:

$ python mnist_ae.py

Using Theano backend.

Reading data files.

Building network.

Training network.

The test score is [0.52297169762333262, 0.84588199139520592]

Saving networks to file.

$

$ python plot_encodings.py

Using Theano backend.

Reading data files.

Encoding test data.

Plotting results.

$

 

Note that, if you desire, you may implement a variational autoencoder for this assignment, rather than a standard autoencoder, though this is not required. 

Your scripts will be graded on functionality, but also on form.  This means your scripts should use meaningful variable names and be well commented.


Submit your 2 scripts to the 'Assignment Dropbox'

Assignments will be graded on a 10 point basis.
Due date is May 31st 2018 (midnight), with 0.5 penalty point per day off for late submission until the cut-off date of June 7th, at 11:00am.

Last Modified: Thursday May 24, 2018 - 13:36. Revision: 24. Release Date: Thursday May 24, 2018 - 12:00.


Content Navigation


Course Calendar


Related



Questions? Contact Support.
Web site engine's code is copyright © ATutor®.
Modifications and code of added modules are copyright of SciNet.