Skip to content

Commit 4a57e33

Browse files
Add citation warning to KMNIST dataset, #7
1 parent fb56421 commit 4a57e33

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

extra_keras_datasets/kmnist.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@
1414

1515
from tensorflow.keras.utils import get_file
1616
import numpy as np
17+
import logging
18+
19+
20+
def warn_citation():
21+
"""Warns about citation requirements
22+
# Returns
23+
Void
24+
"""
25+
logging.warning(("Please cite the following paper when using or"
26+
" referencing this Extra Keras Dataset:"))
27+
logging.warning(
28+
("Clanuwat, T., Bober-Irizar, M., Kitamoto, A., Lamb, A., "
29+
"Yamamoto, K., & Ha, D. (2018). Deep learning for classical "
30+
"Japanese literature arXiv preprint arXiv:1812.01718. "
31+
"Retrieved from https://arxiv.org/abs/1812.01718")
32+
)
1733

1834

1935
def load_data(path="kmnist.npz", type="kmnist"):
@@ -58,5 +74,8 @@ def load_data(path="kmnist.npz", type="kmnist"):
5874
)
5975
target_test = np.load(path_test_labels)["arr_0"]
6076

77+
# Warn about citation
78+
warn_citation()
79+
6180
# Return data
6281
return (input_train, target_train), (input_test, target_test)

0 commit comments

Comments
 (0)