Open
Description
We could have a "processed" folder in each dataset folder where we write the dataset object the first time we create it. In the following creations, e.g. d = MNIST()
we just load the JLD2 file.
Example:
function MNIST(...)
dataset_dir = ...
processed_file = joinpath(dataset_dir, "processed", "dataset.jld2")
if isfile(processed_file)
return FileIO.load(processed_file, "dataset")
end
mnist = ...
if isfile(processed_file)
FileIO.save(processed_file, Dict("dataset" => mnist))
end
return mnist
end