This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) { |