GithubHelp home page GithubHelp logo

nhatch / mnist Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 972 KB

An investigation into neural networks using the MNIST database of handwritten digits.

HTML 0.91% CSS 1.11% JavaScript 19.21% Python 78.77%

mnist's Introduction

MNIST

An investigation into neural networks using the MNIST database of handwritten digits.

Two machine learning algorithms have been implemented: softmax (multiclass logistic regression) and multilayer perceptron (MLP, a kind of neural network).

Currently, the error rates for softmax and MLP are respectively about 10% and 3%.

MNIST Viewer

A simple page for viewing MNIST images.

  1. Download/unzip MNIST's "t10k-images-idx3-ubyte" into this directory.
  2. Create a soft link "test-images" for this file: ln -s t10k-images-idx3-ubyte test-images
  3. Start a web server in this directory. For example: python -m SimpleHTTPServer
  4. Visit the server in a web browser. (In the example above, it's at localhost:8000.) Have fun!

Trying out the algorithms

  1. Download/unzip the MNIST data (four files total) into this directory.
  2. Create soft links "train-images", "train-labels", "test-images", and "test-labels" for these files.
  3. Test it out (see code below).
  4. Feel free to poke around with the algorithm constants to see if you can reduce the error rate.
  5. If you're curious about the incorrect predictions, open up the viewer. (They're automatically saved to a file called incorrect_predictions and thereby automatically displayed.)
import graddesc, softmax, mlp
train = graddesc.training_examples() # takes a few seconds
test = graddesc.testing_examples()
graddesc.alg = mlp # or softmax
graddesc.run(train, test, test) # takes quite a while

Note: currently the validation examples (the second parameter to graddesc.run) aren't used for anything.

IDX Manipulation

idx.py contains a more general IDX reader/writer, as well as some helper methods for preprocessing the MNIST data (cropping the images, for example).

Future work

  • Compare our approach to Nielsen's http://neuralnetworksanddeeplearning.com/ (which achieves 2% error rate with only one hidden layer)
  • Try using some other tricks: dropout, max-norm regularization, generative pre-training, other activation functions (ReLU, maxout)
  • GPU optimization

mnist's People

Contributors

nhatch avatar

Stargazers

Rui Dai avatar

Watchers

James Cloos avatar  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.