The repository contains a neural network written from scratch on Haskell, with accompanying Flask app that allows a user to draw a digit to be predicted on. Some features of the project include:
- Feed forward neural network using 1 hidden layer
- Backpropagation algorithm
- Gradient descrent algorithm
- Image conversion using JuicyPixels and HIP libraries
- Flask app for web server and interface that uses HTML/JS/CSS
Requirements: Python 3, virtualenv, GHC, Stack, Unix
Haskell Platform (with GHC) available at: https://www.haskell.org/platform/
Haskell Tool Stack install instructions: https://docs.haskellstack.org/en/stable/README
You must have Stack installed in order to run the Haskell script from within the Flask app. Then follow these steps:
- Make a virtual environment for python:
python3 -m venv env
. Activate withsource env/bin/activate
. - Run requirements.txt.
pip3 install -r requirements.txt
- Run flask app.
python3 main.py
- Go to
localhost:9091
on your browser to draw and get the prediction. - Deactivate virtualenv with command
deactivate