https://github.com/rnuv/artificial-neural-network
A Simple 2 layered Artificial Neural Network library made from scratch in Python and NumPy. Fitted with a feed forward method and backpropagation.
https://github.com/rnuv/artificial-neural-network
neural-network numpy python tensorflow
Last synced: over 1 year ago
JSON representation
A Simple 2 layered Artificial Neural Network library made from scratch in Python and NumPy. Fitted with a feed forward method and backpropagation.
- Host: GitHub
- URL: https://github.com/rnuv/artificial-neural-network
- Owner: rNuv
- Created: 2021-01-26T15:51:42.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-06-15T05:50:09.000Z (about 3 years ago)
- Last Synced: 2025-01-24T10:27:01.715Z (over 1 year ago)
- Topics: neural-network, numpy, python, tensorflow
- Language: Python
- Homepage:
- Size: 180 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Artificial Neural Network
## Description
This is a Python implementation of a very rudimentary 2 layer Neural Network class. The class features a method to feed forward a certain instance for a prediction and another method to train and adjust its weights based on a labelled data instance. I tested the neural network on a linearly inseparable problem like the XOR logic gate. I then tested it on the MNIST database of handwritten digits. With 784 input nodes, 64 hidden nodes and 10 output nodes, the net acheives about 94% accuracy on 10000 test images after being trained with 5 epochs on 60000 training images, which isn't too shabby 🤷 I compared my results with the same neural network implementation in Tensorflow and Tensorflow acheived about an accuracy of about 95-96%.
## Instructions
Clone the repo and install the dependencies with
```
pip install -r requirements.txt
```
Download the MNIST data from the link below and place all 4 ubyte files in a folder called *data*. Label them *training_images*, *training_labels*, *test_images* and *test_labels* accordingly. Run the mnist_nn module to test the custom neural network and measure its performance. Run the mnist_tf module to test a Tensorflow implementation of the same neural network architecture on the MNIST data as a comparison.
```
python3 mnist_nn.py
```
```
python3 mnist_tf.py
```
## Pictures
Results of the neural network implementation.
## Technologies
- 
- 
- 
- MNIST database (http://yann.lecun.com/exdb/mnist/)
---
*Made with <3 by Arnav, circa 2020*