Skip to content

Implementation of a multi layer perceptron artificial neural network from scratch that is tested using the MNIST dataset.

License

Notifications You must be signed in to change notification settings

NoahFeldt/ANN-From-Scratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ANN-From-Scratch

Implementation of a multi layer perceptron artificial neural network from scratch that is tested using the MNIST dataset.

Prerequisites

The NumPy module is used for numerical vector and matrix calculations:

pip install numpy

The Keras module is used to import the MNIST dataset:

pip install keras

The tqdm module is used for creating the progress bar:

pip install tqdm

Design choices

The neural network implementation uses the following design choices:

  • Sigmoid activation function.

  • Xavier Glorot initialization of the weights.

  • Zero initialization of the biases.

  • Mean squared error cost function.

Usage

The neural network implementation, can be found in the ann.py module where the NeuralNetwork class exists.

To test the neural network on the MNIST dataset, run the mnist.py file. This script will train and test a neural network with the given parameters.

Results

The neural network reaches an accuracy of about 90.5 % on MNIST dataset with the parameters used in the mnist.py file.