comply to PEP 8
This commit is contained in:
parent
4889740414
commit
eac50b5681
2
TODO
2
TODO
|
@ -2,8 +2,6 @@ TODO
|
||||||
|
|
||||||
* add prefixes and links to shape table
|
* add prefixes and links to shape table
|
||||||
|
|
||||||
* abide to PEP 8
|
|
||||||
|
|
||||||
* finish writing README
|
* finish writing README
|
||||||
|
|
||||||
* finish npz functionality
|
* finish npz functionality
|
||||||
|
|
|
@ -42,14 +42,14 @@ def make_emnist_meta(npz, name):
|
||||||
|
|
||||||
|
|
||||||
metadata = dict(
|
metadata = dict(
|
||||||
emnist_balanced = make_emnist_meta("emnist_balanced.npz", "emnist-balanced"),
|
emnist_balanced=make_emnist_meta("emnist_balanced.npz", "emnist-balanced"),
|
||||||
emnist_byclass = make_emnist_meta("emnist_byclass.npz", "emnist-byclass"),
|
emnist_byclass=make_emnist_meta("emnist_byclass.npz", "emnist-byclass"),
|
||||||
emnist_bymerge = make_emnist_meta("emnist_bymerge.npz", "emnist-bymerge"),
|
emnist_bymerge=make_emnist_meta("emnist_bymerge.npz", "emnist-bymerge"),
|
||||||
emnist_digits = make_emnist_meta("emnist_digits.npz", "emnist-digits"),
|
emnist_digits=make_emnist_meta("emnist_digits.npz", "emnist-digits"),
|
||||||
emnist_letters = make_emnist_meta("emnist_letters.npz", "emnist-letters"),
|
emnist_letters=make_emnist_meta("emnist_letters.npz", "emnist-letters"),
|
||||||
emnist_mnist = make_emnist_meta("emnist_mnist.npz", "emnist-mnist"),
|
emnist_mnist=make_emnist_meta("emnist_mnist.npz", "emnist-mnist"),
|
||||||
fashion_mnist = make_meta("fashion_mnist.npz", prefix="fashion-mnist"),
|
fashion_mnist=make_meta("fashion_mnist.npz", prefix="fashion-mnist"),
|
||||||
mnist = make_meta("mnist.npz", prefix="mnist"),
|
mnist=make_meta("mnist.npz", prefix="mnist"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ def download(name):
|
||||||
url = webhost + url_name
|
url = webhost + url_name
|
||||||
try:
|
try:
|
||||||
urlretrieve(url, path)
|
urlretrieve(url, path)
|
||||||
except:
|
except Exception:
|
||||||
lament(f"Failed to download {url} to {path}")
|
lament(f"Failed to download {url} to {path}")
|
||||||
raise
|
raise
|
||||||
return already_exists
|
return already_exists
|
||||||
|
@ -180,8 +180,8 @@ def prepare(dataset="mnist", return_floats=True, return_onehot=True,
|
||||||
|
|
||||||
# correct the orientation of emnist images.
|
# correct the orientation of emnist images.
|
||||||
if prefix == "emnist":
|
if prefix == "emnist":
|
||||||
train_images_data = train_images_data.transpose(0,1,3,2)
|
train_images_data = train_images_data.transpose(0, 1, 3, 2)
|
||||||
test_images_data = test_images_data.transpose(0,1,3,2)
|
test_images_data = test_images_data.transpose(0, 1, 3, 2)
|
||||||
|
|
||||||
if return_floats: # TODO: better name.
|
if return_floats: # TODO: better name.
|
||||||
train_images_data = train_images_data.astype(np.float32) / 255
|
train_images_data = train_images_data.astype(np.float32) / 255
|
||||||
|
|
Loading…
Reference in New Issue
Block a user