Giter Site home page Giter Site logo

handwritingai's Introduction

handwritingAI

A neural network to classify handwritten numbers. The code is based off of this book by Michael Nielsen.

Setup environment

python -m venv .
source venv/bin/activate
pip install -r requirements.txt

Data

The data are a part of the mnist module.

All data is taken from the MNIST dataset curated by Yann LeCun, Corinna Cortes, and Christopher J.C. Burges from this website.

Run

Running python handwritingAI.py --train will train the AI with the default number of layers (1 hidden layer with 10 nodes), a learning rate of 3 (eta = 3), and a mini-batch size of 10. After the training is finished, the AI's information will be saved in configs/config.conf.

To use this default config file to predict against the test data, run python handwritingAI.py --predict.

To do all of this all at once, run python handwritingAI.py --trian --predict.

For a full listing of all options, run python handwritingAI.py -h.

Viewing the Images

The program has support for displaying the images.

To display the first 100 images with matplotlib of the training dataset, run python handwritingAI.py -n 100 --train -d.

To save that figure as an image, run python handwritingAI.py -n 100 --train -d --save-image image.png.

training images

Similarly, to display first 100 images with matplotlib of the test dataset, run python handwritingAI.py -n 100 --train -d.

You can tell the program to color the images according to the how a particular AI configuration predicts the values, run python handwritingAI.py -c <config> -n 100 --train -d -C.

predicted values

To view the 100 images starting at the 1000th test (or training) image, run python handwritingAI.py -c <config> -n 100 --image-display-offset 1000 --predict -d -C. predicted values starting at the 1000th test image

Resources used to make thie AI.

handwritingai's People

Contributors

k20shores avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.