load data

This commit is contained in:
Mike J Innes 2018-01-17 16:39:55 +00:00
parent bd57359535
commit 72eabde373
1 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,7 @@ Returns the 60,000 training images by default; pass `:test` to retreive the
10,000 test images.
"""
function images(set = :train)
load()
io = IOBuffer(read(set == :train ? TRAINIMAGES : TESTIMAGES))
_, N, nrows, ncols = imageheader(io)
[rawimage(io) for _ in 1:N]
@ -97,6 +98,7 @@ Returns the 60,000 training labels by default; pass `:test` to retreive the
10,000 test labels.
"""
function labels(set = :train)
load()
io = IOBuffer(read(set == :train ? TRAINLABELS : TESTLABELS))
_, N = labelheader(io)
[rawlabel(io) for _ = 1:N]