https://github.com/sony/nnabla-js
https://github.com/sony/nnabla-js
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/sony/nnabla-js
- Owner: sony
- License: apache-2.0
- Created: 2022-09-16T14:35:26.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-13T06:23:30.000Z (over 2 years ago)
- Last Synced: 2025-01-01T05:44:47.285Z (9 months ago)
- Language: TypeScript
- Size: 271 KB
- Stars: 1
- Watchers: 21
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nnabla-js
[](https://github.com/nnabla/nnabla-js/actions/workflows/test.yaml)
[](https://github.com/nnabla/nnabla-js/blob/master/LICENSE)A JavaScript runtime for Neural Network Libraries.

## 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](examples)!```js
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](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
```