2017-11-01 16:01:34 +00:00
|
|
|
module Data
|
|
|
|
|
2017-11-06 12:01:47 +00:00
|
|
|
import ..Flux
|
2019-01-30 11:56:54 +00:00
|
|
|
import SHA
|
2017-11-06 12:01:47 +00:00
|
|
|
|
2020-02-26 12:48:27 +00:00
|
|
|
using Random: shuffle!
|
|
|
|
using Base: @propagate_inbounds
|
|
|
|
|
2017-11-01 16:01:34 +00:00
|
|
|
export CMUDict, cmudict
|
|
|
|
|
|
|
|
deps(path...) = joinpath(@__DIR__, "..", "..", "deps", path...)
|
|
|
|
|
2019-01-30 11:56:54 +00:00
|
|
|
function download_and_verify(url, path, hash)
|
|
|
|
tmppath = tempname()
|
|
|
|
download(url, tmppath)
|
|
|
|
hash_download = open(tmppath) do f
|
|
|
|
bytes2hex(SHA.sha256(f))
|
|
|
|
end
|
|
|
|
if hash_download !== hash
|
|
|
|
msg = "Hash Mismatch!\n"
|
|
|
|
msg *= " Expected sha256: $hash\n"
|
|
|
|
msg *= " Calculated sha256: $hash_download"
|
|
|
|
error(msg)
|
|
|
|
end
|
|
|
|
mv(tmppath, path; force=true)
|
|
|
|
end
|
|
|
|
|
2017-11-01 16:01:34 +00:00
|
|
|
function __init__()
|
|
|
|
mkpath(deps())
|
|
|
|
end
|
|
|
|
|
2020-02-26 12:48:27 +00:00
|
|
|
include("dataloader.jl")
|
|
|
|
export DataLoader
|
|
|
|
|
2018-01-17 15:55:37 +00:00
|
|
|
include("mnist.jl")
|
2018-08-20 15:57:43 +00:00
|
|
|
export MNIST
|
|
|
|
|
2018-10-01 19:26:26 +00:00
|
|
|
include("fashion-mnist.jl")
|
|
|
|
export FashionMNIST
|
|
|
|
|
2017-11-01 16:01:34 +00:00
|
|
|
include("cmudict.jl")
|
|
|
|
using .CMUDict
|
|
|
|
|
2018-02-13 15:45:33 +00:00
|
|
|
include("tree.jl")
|
2017-11-02 11:41:28 +00:00
|
|
|
include("sentiment.jl")
|
|
|
|
using .Sentiment
|
|
|
|
|
2019-02-07 00:17:59 +00:00
|
|
|
include("iris.jl")
|
|
|
|
export Iris
|
|
|
|
|
2020-02-06 22:17:19 +00:00
|
|
|
include("housing.jl")
|
|
|
|
export Housing
|
|
|
|
|
2020-04-29 08:18:16 +00:00
|
|
|
@deprecate DataLoader(x...; kws...) DataLoader(x; kws...)
|
|
|
|
|
2017-11-01 16:01:34 +00:00
|
|
|
end
|