Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cawfree/mnist-dataset
✍️ Yann LeCun's MNIST handwritten digit dataset, made available to Node.js.
https://github.com/cawfree/mnist-dataset
dataset deep digit handwriting handwritten learning mnist network neural number
Last synced: 12 days ago
JSON representation
✍️ Yann LeCun's MNIST handwritten digit dataset, made available to Node.js.
- Host: GitHub
- URL: https://github.com/cawfree/mnist-dataset
- Owner: cawfree
- License: mit
- Created: 2020-02-04T23:29:30.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-05T00:41:53.000Z (almost 5 years ago)
- Last Synced: 2024-09-16T01:04:52.885Z (2 months ago)
- Topics: dataset, deep, digit, handwriting, handwritten, learning, mnist, network, neural, number
- Language: JavaScript
- Size: 94.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mnist-dataset
✍️ Yann LeCun's MNIST handwritten digit dataset, made available to Node.js. This library contains all of the utilities you need to download and parse the raw unfiltered dataset, which is expressed as JSON arrays. It uses [fs](https://nodejs.org/api/fs.html) to cache to your system's [`tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) so that you don't have to keep downloading the dataset between successive executions of your software.
## 🚀 Getting Started
Using [`npm`]():
```bash
npm install --save mnist-dataset
```Using [`yarn`]():
```bash
yarn add mnist-dataset
```## ✍️ Usage
```javascript
import { cache, trainingImagesUrl, trainingLabelsUrl } from 'mnist-dataset';(
async () => {
const trainingImages = await cache(trainingImagesUrl); // [[Number]] (i.e. [[0, 0, 0, ...], [0, 0, 0, ...], ...])
const trainingLabels = await cache(trainingLabelsUrl); // [[Number]] (i.e. [[7], [2], ...])const toString = e =>
[...Array(28)]
.map((_, i) =>
[...Array(28)].map((_, j) => (e[i * 28 + j] > 128 ? "#" : " ")).join("")
)
.join("\n");const [number7] = trainingImages;
console.log(toString(number7));
}
)();
```## ✌️ License
[MIT](https://opensource.org/licenses/MIT)