Skip to content

Commit

Permalink
Merge pull request #13 from christianversloot/log-loading
Browse files Browse the repository at this point in the history
Add loading notification, #9
  • Loading branch information
christianversloot authored Nov 30, 2020
2 parents 0e0e6be + 3dcecd8 commit 8004180
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extra_keras_datasets/emnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def load_data(path="emnist_matlab.npz", type="balanced"):
Tuple of Numpy arrays: `(input_train, target_train),
(input_test, target_test)`.
"""
# Log about loading
logging.basicConfig(level=logging.INFO)
logging.info('Loading dataset = emnist')

# Load data
path = get_file(
path, origin=("http://www.itl.nist.gov/iaui/vip/cs_links/EMNIST/"
"matlab.zip")
Expand Down
5 changes: 5 additions & 0 deletions extra_keras_datasets/iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def load_data(path="iris.npz", test_split=0.2):
Target structure: 0 = iris setosa; 1 = iris versicolor;
2 = iris virginica.
"""
# Log about loading
logging.basicConfig(level=logging.INFO)
logging.info('Loading dataset = iris')

# Load data
path = get_file(
path,
origin=("http://archive.ics.uci.edu/ml/machine-learning-databases/"
Expand Down
4 changes: 4 additions & 0 deletions extra_keras_datasets/kmnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def load_data(path="kmnist.npz", type="kmnist"):
Tuple of Numpy arrays: `(input_train, target_train),
(input_test, target_test)`.
"""
# Log about loading
logging.basicConfig(level=logging.INFO)
logging.info('Loading dataset = kmnist')

# Load training images
path_train = get_file(
f"{path}_{type}_train_imgs",
Expand Down
4 changes: 4 additions & 0 deletions extra_keras_datasets/stl10.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def load_data(path="stl10_matlab.tar.gz"):
Tuple of Numpy arrays: `(input_train, target_train),
(input_test, target_test)`.
"""
# Log about loading
logging.basicConfig(level=logging.INFO)
logging.info('Loading dataset = stl-10')

# Set local .tar.gz path and delete if already available
local_targz_path = "./stl-10"
shutil.rmtree(local_targz_path, ignore_errors=True)
Expand Down
5 changes: 5 additions & 0 deletions extra_keras_datasets/svhn.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def load_data(path="svhn_matlab.npz", type="normal"):
Tuple of Numpy arrays: `(input_train, target_train),
(input_test, target_test)`.
"""
# Log about loading
logging.basicConfig(level=logging.INFO)
logging.info('Loading dataset = svhn')

# Load data
path_train = get_file(
f"{path}_train", origin=("http://ufldl.stanford.edu/housenumbers/"
"train_32x32.mat")
Expand Down

0 comments on commit 8004180

Please sign in to comment.