Skip to content

Commit bb93cbf

Browse files
Add citation warning to SVHN dataset, #7
1 parent 23c7d83 commit bb93cbf

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

extra_keras_datasets/svhn.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,25 @@
1616
from tensorflow.keras.utils import get_file
1717
import numpy as np
1818
from scipy import io as sio
19+
import logging
20+
21+
22+
def warn_citation():
23+
"""Warns about citation requirements
24+
# Returns
25+
Void
26+
"""
27+
logging.warning(("Please cite the following paper when using or"
28+
" referencing this Extra Keras Dataset:"))
29+
logging.warning(
30+
("Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, "
31+
"Andrew Y. Ng Reading Digits in Natural Images with Unsupervised "
32+
"Feature Learning NIPS Workshop on Deep Learning and Unsupervised "
33+
"Feature Learning 2011. Retrieved from "
34+
"http://ufldl.stanford.edu/housenumbers/nips2011_housenumbers.pdf")
35+
)
36+
logging.warning(("Noncommercial use is allowed only: see the "
37+
"SVHN website for more information."))
1938

2039

2140
def load_data(path="svhn_matlab.npz", type="normal"):
@@ -66,5 +85,8 @@ def load_data(path="svhn_matlab.npz", type="normal"):
6685
input_train = np.concatenate((input_extra, input_train))
6786
target_train = np.concatenate((target_extra, target_train))
6887

88+
# Warn about citation
89+
warn_citation()
90+
6991
# Return data
7092
return (input_train, target_train), (input_test, target_test)

0 commit comments

Comments
 (0)