fixes #343
This commit is contained in:
parent
53be49b102
commit
93c4a6b4b5
2
REQUIRE
2
REQUIRE
@ -4,7 +4,7 @@ MacroTools 0.3.3
|
|||||||
NNlib
|
NNlib
|
||||||
Requires
|
Requires
|
||||||
Adapt
|
Adapt
|
||||||
GZip
|
CodecZlib
|
||||||
Colors
|
Colors
|
||||||
ZipFile
|
ZipFile
|
||||||
AbstractTrees
|
AbstractTrees
|
||||||
|
@ -1,11 +1,17 @@
|
|||||||
module MNIST
|
module MNIST
|
||||||
|
|
||||||
using GZip, Colors
|
using CodecZlib, Colors
|
||||||
|
|
||||||
const Gray = Colors.Gray{Colors.N0f8}
|
const Gray = Colors.Gray{Colors.N0f8}
|
||||||
|
|
||||||
const dir = joinpath(@__DIR__, "../../deps/mnist")
|
const dir = joinpath(@__DIR__, "../../deps/mnist")
|
||||||
|
|
||||||
|
function gzopen(f, file)
|
||||||
|
open(file) do io
|
||||||
|
f(GzipDecompressorStream(io))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function load()
|
function load()
|
||||||
mkpath(dir)
|
mkpath(dir)
|
||||||
cd(dir) do
|
cd(dir) do
|
||||||
@ -17,7 +23,7 @@ function load()
|
|||||||
@info "Downloading MNIST dataset"
|
@info "Downloading MNIST dataset"
|
||||||
download("https://cache.julialang.org/http://yann.lecun.com/exdb/mnist/$file.gz", "$file.gz")
|
download("https://cache.julialang.org/http://yann.lecun.com/exdb/mnist/$file.gz", "$file.gz")
|
||||||
open(file, "w") do io
|
open(file, "w") do io
|
||||||
write(io, GZip.open(read, "$file.gz"))
|
write(io, gzopen(read, "$file.gz"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user