Git Product home page Git Product logo

mnist-dataset's Introduction

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 to cache to your system's tmpdir() so that you don't have to keep downloading the dataset between successive executions of your software.

code style: prettier

🚀 Getting Started

Using npm:

npm install --save mnist-dataset

Using yarn:

yarn add mnist-dataset

✍️ Usage

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

Buy @cawfree a coffee

mnist-dataset's People

Contributors

cawfree avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.