mnist-async
Installation
pip install mnist-async
Usage
From a synchronous environment, such as an interactive terminal, by using asyncio.run()
import asyncio
from mnist_async import mnist
train_images, train_labels, test_images, test_labels = asyncio.run(mnist())
Or from another coroutine, by using await
import asyncio
from mnist_async import mnist
async def main():
train_images, train_labels, test_images, test_labels = await mnist()
if __name__ == '__main__':
asyncio.run(main())
Image data
Images are rows, each of length 784, and with pixel values scaled to the range zero through one.
Label data
Lables are one-hot rows each of length ten.
[0 0 1 ... 0] # 3
[0 0 0 ... 1] # 9