Skip to content

arkcorn/neural-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

neural-network

This is a neural network I made and trained from scratch for the purpose of recognizing hand drawn digits from the mnist image dataset.
I did not use any machine learning libraries in the creation of this network (PyTorch, Tensorflow, etc.).

How to use

tl;dr clone the repo, open test.ipynb, pip install numpy, matplotlib, scipy, tensorflow (for mnist dataset), run all cells except for labeled "Tests the network" (Unless you want to see the accuracy rate for yourself!), following instructions in last 2 cells to test various images in the mnist dataset

There are 2 files included in the repo: train.ipynb and test.ipynb
train.ipynb is the code used to train the model, but the code is mostly the same as test.ipynb
test.ipynb is for testing the model (THIS IS THE FILE YOU PROBABLY ARE LOOKING FOR).

Network Architecture

The network is composed of 4 layers of size 784 x 16 x 16 x 10
Layer 1 is composed of 784 neurons because each input image is 28x28 pixels (a total of 784 pixels to be used as input)
The size of layers 2-3 are chosed arbitrarily
Layer 4 is composed of 10 neurons to represent all possible outputs (digits 0-9)

Training

The network backpropagates through stochastic gradient descent

Resources that helped me:
3Blue1Brown's Neural Network Playlist
3Blue1Brown's Neural Network Articles
Neural Networks and Deep Learning by Michael Nielson
colah's blog post on Backpropagation

About

(MNIST) Neural network from scratch using Python, based on 3Blue1Brown's video playlist

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published