Simple demo app to recognize hand written digits with 3 layers neural net in pure python
- Install the dependencies
> pip install -r requirements.txt
- Run the server
> gunicorn app:app
[2017-11-24 17:29:40 +0300] [22162] [INFO] Starting gunicorn 19.7.1
[2017-11-24 17:29:40 +0300] [22162] [INFO] Listening at: http://127.0.0.1:8000 (22162)
[2017-11-24 17:29:40 +0300] [22162] [INFO] Using worker: sync
[2017-11-24 17:29:40 +0300] [22165] [INFO] Booting worker with pid: 22165
- Open http://127.0.0.1:8000 in your browser or try demo
Open any python interpreter
- Get training data
import mnist_loader
training_data, validation_data, test_data = mnist_loader.load_data_wrapper()
training_data = list(training_data)
test_data = list(test_data)
- Start teaching with your parameters
from network import Network
# 784 - input layer (28x28 pic size)
# 30 - hidden layer (any value)
# 10 - output layer (from 0 to 9)
# You should change only hidden layer
net = Network([784, 30, 10])
# Feel free to change these parameters
# 20 - epoch count
# 10 - batch size
# 3.0 - training speed
net.train(training_data, 20, 10, 3.0, test_data)
net.save_to_file('./networks/network_30_20-10-3.json')
Feel free to contribute, rewrite, improve or do it with TensorFlow