Training My Neural Network with the MNIST (Handwritten Digits) Dataset

I trained my neural network with the MNIST dataset in this project. The MNIST dataset consists of handwritten images (60,000 images in the training set and 10,000 images in the test set). (Link to Github Repo of Source Code).

The neural network with forward propagation and back-propagation pass is implemented in neural_network.py. The MyImg2Num neural network is defined in my_img2num.py. It relies on the Neural Network class implemented in neural_network.py for its functionality. The NnImg2Num neural network is defined in nn_img2num.py. This neural network uses the torch.nn neural network package for its functionality. Finally both of these neural networks are trained and tested on the MNIST handwritten digits dataset. In order to run the scripts, simply create an instance of the corresponding class and call the train() instance method as shown below.

nn_mnist = NnImg2Num()

nn_mnist.train()

my_mnist = MyImg2Num()

my_mnist.train()

The performance charts associated with each of the neural networks are given below.

NnImg2Num Neural Network

MyImg2Num Neural Network

Written on April 13, 2018

Code. Debug. Repeat. Currently an SDE II at Amazon AI (AWS SageMaker Hosting). Always promoting curiosity, camaraderie and compassion. All opinions are my own.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store