Skip to content

sony/nnabla-js

Repository files navigation

nnabla-js

test license

A JavaScript runtime for Neural Network Libraries.

demo

key features

  • Run on web browsers
  • Load and execute .nnp files
  • Support GPU (WebGL)
  • Preprocess utilities (e.g. image resizing)

installation

$ npm install nnabla-js

example

Check out more examples!

const fs = require('fs');
const nnabla = require('nnabla-js');

const x = [...Array(28 * 28)].map(() => Math.random() * 2.0 - 1.0);

// Load your NNP file
fs.readFile('mnist.nnp', (_, data) => {
  // Build computation graph from NNP
  nnabla.NNP.fromNNPData(data).then((nnp) => {
    // Forward propagation with the specified executor
    const output = nnp.forward('runtime', { 'x0': x });
  });
});

documentation

Documents are available in docs.

build

protoc command must be installed prior to build.

$ npm install
$ ./scripts/build_protobuf_file.sh
$ npm run build:dev

test

$ pip install nnabla & python scripts/create_test_nnp.py  # for the first time
$ npm run lint:fix  # code style check
$ npm test  # unit tests

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published