rewrite main to dump tables instead

This commit is contained in:
Connor Olding 2018-03-15 02:10:28 +01:00
parent 14f07db52c
commit 7bfde8e5cc
2 changed files with 28 additions and 61 deletions

View File

@ -34,62 +34,19 @@ pass `flatten=True` to `mnists.prepare` to get (n, 784).
## datasets
in alphabetical order:
### [emnist][emnist]
* `emnist_balanced`
train images shape: (112800, 1, 28, 28)
train labels shape: (112800, 47)
test images shape: (18800, 1, 28, 28)
test labels shape: (18800, 47)
* `emnist_byclass`
train images shape: (697932, 1, 28, 28)
train labels shape: (697932, 62)
test images shape: (116323, 1, 28, 28)
test labels shape: (116323, 62)
* `emnist_bymerge`
train images shape: (697932, 1, 28, 28)
train labels shape: (697932, 47)
test images shape: (116323, 1, 28, 28)
test labels shape: (116323, 47)
* `emnist_digits`
train images shape: (240000, 1, 28, 28)
train labels shape: (240000, 10)
test images shape: (40000, 1, 28, 28)
test labels shape: (40000, 10)
* `emnist_letters`
train images shape: (124800, 1, 28, 28)
train labels shape: (124800, 26)
test images shape: (20800, 1, 28, 28)
test labels shape: (20800, 26)
* `emnist_mnist`
train images shape: (60000, 1, 28, 28)
train labels shape: (60000, 10)
test images shape: (10000, 1, 28, 28)
test labels shape: (10000, 10)
### [fashion-mnist][fashion-mnist]
* `fashion_mnist`
train images shape: (60000, 1, 28, 28)
train labels shape: (60000, 10)
test images shape: (10000, 1, 28, 28)
test labels shape: (10000, 10)
### [mnist][mnist]
* `mnist`
train images shape: (60000, 1, 28, 28)
train labels shape: (60000, 10)
test images shape: (10000, 1, 28, 28)
test labels shape: (10000, 10)
in alphabetical order, using default `mnists.prepare` parameters:
[emnist]: //www.nist.gov/itl/iad/image-group/emnist-dataset
[fashion-mnist]: //github.com/zalandoresearch/fashion-mnist
[mnist]: http://yann.lecun.com/exdb/mnist/
| dataset | train images shape | train labels shape | test images shape | test labels shape |
| :--- | ---: | ---: | ---: | ---: |
| emnist\_balanced | (112800, 1, 28, 28) | (112800, 47) | (18800, 1, 28, 28) | (18800, 47) |
| emnist\_byclass | (697932, 1, 28, 28) | (697932, 62) | (116323, 1, 28, 28) | (116323, 62) |
| emnist\_bymerge | (697932, 1, 28, 28) | (697932, 47) | (116323, 1, 28, 28) | (116323, 47) |
| emnist\_digits | (240000, 1, 28, 28) | (240000, 10) | (40000, 1, 28, 28) | (40000, 10) |
| emnist\_letters | (124800, 1, 28, 28) | (124800, 26) | (20800, 1, 28, 28) | (20800, 26) |
| emnist\_mnist | (60000, 1, 28, 28) | (60000, 10) | (10000, 1, 28, 28) | (10000, 10) |
| fashion\_mnist | (60000, 1, 28, 28) | (60000, 10) | (10000, 1, 28, 28) | (10000, 10) |
| mnist | (60000, 1, 28, 28) | (60000, 10) | (10000, 1, 28, 28) | (10000, 10) |

View File

@ -1,13 +1,23 @@
from . import metadata, prepare
names = ("train images", "train labels", "test images", "test labels")
headers = ("dataset",
"train images shape",
"train labels shape",
"test images shape",
"test labels shape")
row = "| {:<20} | {:<20} | {:<20} | {:<20} | {:<20} |"
separators = (":---", "---:", "---:", "---:", "---:")
print(row.format(*headers))
print(row.format(*separators))
for name in metadata.keys():
# verify every dataset, downloading if necessary.
# print out the shapes for use in the README.
print(f" * `{name}` ")
# print out the shape table for use in the README.
data = prepare(name)
for name, dat in zip(names, data):
print(f" {name} shape: {dat.shape} ")
print()
row_data = [name.replace("_", "\\_")]
row_data += [str(array.shape) for array in data]
print(row.format(*row_data))