Skip to content

Instantly share code, notes, and snippets.

View dankoc's full-sized avatar

Charles Danko dankoc

View GitHub Profile
@dankoc
dankoc / gist:9178562
Created February 23, 2014 22:57 — forked from brendano/gist:39760
# Load the MNIST digit recognition dataset into R
# http://yann.lecun.com/exdb/mnist/
# assume you have all 4 files and gunzip'd them
# creates train$n, train$x, train$y and test$n, test$x, test$y
# e.g. train$x is a 60000 x 784 matrix, each row is one digit (28x28)
# call: show_digit(train$x[5,]) to see a digit.
# brendan o'connor - gist.github.com/39760 - anyall.org
load_mnist <- function() {
load_image_file <- function(filename) {