From 2e970d6ca4f157fd44084b81ca94019d021ed6a6 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Thu, 15 Mar 2018 02:40:56 +0100 Subject: [PATCH] make integrity checks optional --- mnists/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mnists/__init__.py b/mnists/__init__.py index 3b504e6..cb4efe9 100644 --- a/mnists/__init__.py +++ b/mnists/__init__.py @@ -146,7 +146,7 @@ def batch_flatten(x): def prepare(dataset="mnist", return_floats=True, return_onehot=True, - flatten=False, squeeze_layers=True): + flatten=False, squeeze_layers=True, check_integrity=True): if dataset not in metadata.keys(): raise Exception(f"Unknown dataset: {dataset}") @@ -163,7 +163,8 @@ def prepare(dataset="mnist", return_floats=True, return_onehot=True, for name in images_and_labels: download(name) - validate(name) + if check_integrity: + validate(name) if npz_existing: with np.load(construct_path(npz)):