A JavaScript runtime for Neural Network Libraries.
- Run on web browsers
- Load and execute
.nnp
files - Support GPU (WebGL)
- Preprocess utilities (e.g. image resizing)
$ npm install nnabla-js
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 });
});
});
Documents are available in docs.
protoc
command must be installed prior to build.
$ npm install
$ ./scripts/build_protobuf_file.sh
$ npm run build:dev
$ pip install nnabla & python scripts/create_test_nnp.py # for the first time
$ npm run lint:fix # code style check
$ npm test # unit tests