Skip to content

Commit f4a7d5f

Browse files
Add citation warning to EMNIST dataset, #7
1 parent 4a57e33 commit f4a7d5f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

extra_keras_datasets/emnist.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@
1818
from zipfile import ZipFile
1919
from scipy import io as sio
2020
import os
21+
import logging
22+
23+
24+
def warn_citation():
25+
"""Warns about citation requirements
26+
# Returns
27+
Void
28+
"""
29+
logging.warning(("Please cite the following paper when using or"
30+
" referencing this Extra Keras Dataset:"))
31+
logging.warning(
32+
("Cohen, G., Afshar, S., Tapson, J., & van Schaik, A. (2017). EMNIST: "
33+
"an extension of MNIST to handwritten letters. "
34+
"Retrieved from http://arxiv.org/abs/1702.05373")
35+
)
2136

2237

2338
def load_data(path="emnist_matlab.npz", type="balanced"):
@@ -64,5 +79,8 @@ def load_data(path="emnist_matlab.npz", type="balanced"):
6479
(input_test.shape[0], 28, 28), order="F"
6580
)
6681

82+
# Warn about citation
83+
warn_citation()
84+
6785
# Return data
6886
return (input_train, target_train), (input_test, target_test)

0 commit comments

Comments
 (0)