Mnist dataset for Torch
Lua
Latest commit 37dfe57 Apr 25, 2014 @andresy be torch9 compatible
Permalink
Failed to load latest commit information.
data initial commit with everything! Oct 17, 2013
rocks initial commit with everything! Oct 17, 2013
README.md initial commit with everything! Oct 17, 2013
init.lua be torch9 compatible Apr 25, 2014

README.md

MNIST Dataset for Torch

Please see Yann LeCun's page for the original MNIST dataset.

Installation

torch-rocks install https://raw.github.com/andresy/mnist/master/rocks/mnist-scm-1.rockspec

Usage

local mnist = require 'mnist'

local trainset = mnist.traindataset()
local testset = mnist.testdataset()

print(trainset.size) -- to retrieve the size
print(testset.size) -- to retrieve the size

Then, the i-th example is retrieved with:

local ex = trainset[i]
local x = ex.x -- the input (a 28x28 ByteTensor)
local y = ex.y -- the label (0--9)