View Code? Open in Web Editor
NEW
A scratch implementation of Convolutional Neural Network in Python using only numpy and validated over CIFAR-10 & MNIST Dataset
Home Page: http://cnndigits.pythonanywhere.com/
License: GNU General Public License v3.0
Python 70.13%
JavaScript 6.72%
HTML 23.11%
Procfile 0.05%
cnn-from-scratch's People
cnn-from-scratch's Issues
Description:
Add a function similar to maxpool() in convnet.py for the pooling layer but based on Average Pool method(MNIST folder)
Description:
Currently Xavier Initialization is being used in convnet.py. Write a different function with any other initialization method.
Description:
Add front-end files(html & css) with a very basic structure of the digit recognition app(explained in README) from where the development can start.
Description:
An API which receives image as input and gives digit prediction and its probability for that image as output(from functions available in 'convnet.py' file).
Use 'app.py' file to start from.
[read the README for more details]
I have a question, how to handle non-number prediction?
I tried your Demo and when I wrote C, it was predicted as 5 and when I wrote A, it gave 2.
How to extend the NN so that it can make an output "Unknown" / "Not in the list"?
I am using Python 3.7 on MacOS.
I trained the CNN with the MNIST db and tried running app.py
While it starts and I can access it from 127.0.0.1:5000, as soon as I draw a digit and press Predict I get the following console output.
Serving Flask app "app" (lazy loading)
Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
Debug mode: on
Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Restarting with stat
Debugger is active!
Debugger PIN: 162-250-119
127.0.0.1 - - [25/Aug/2018 00:29:18] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [25/Aug/2018 00:29:18] "GET /static/style/drawingboard.min.css HTTP/1.1" 200 -
127.0.0.1 - - [25/Aug/2018 00:29:18] "GET /static/style/application2.min.css HTTP/1.1" 200 -
127.0.0.1 - - [25/Aug/2018 00:29:18] "GET /static/style/drawingBoard.min.js HTTP/1.1" 200 -
127.0.0.1 - - [25/Aug/2018 00:29:18] "GET /static/style/hermiteResize.js HTTP/1.1" 200 -
127.0.0.1 - - [25/Aug/2018 00:29:23] "POST /digit_process HTTP/1.1" 500 -
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "/Users/dennisfurrer/Desktop/CNN-from-Scratch/app.py", line 23, in digit_process
out = pickle.load(pickle_in)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xca in position 0: ordinal not in range(128)
How to enable training on GPU's ?
Any pointers in that direction?
pointer
This is a little vague pointer as it will depend on where you are trying to put the batch_norm layer.
Everything depends on what is working and what is not and what is the conventional way to it.