Skip to content

Commit

Permalink
Update the README to reflect public opening & update build scripts fo…
Browse files Browse the repository at this point in the history
…r consistency with other repos (uses yalc) (#76)
  • Loading branch information
Nikhil Thorat authored Apr 23, 2018
1 parent 8bc10d7 commit 8ae4c23
Show file tree
Hide file tree
Showing 9 changed files with 1,095 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ dist/
deps/
node_modules/
yarn-error.log
yalc.lock
.yalc/
demo/train-*
13 changes: 13 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.vscode/
demo/
scripts/
src/
node_modules/
*.tgz
.travis.yml
.npmignore
CONTRIBUTING.md
tslint.json
yarn.lock
yalc.lock
.yalc/
58 changes: 43 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,53 @@
# Node.js Support for TensorFlow.js
This package provides TensorFlow as a backend to TensorFlow.js.
# TensorFlow backend for TensorFlow.js via Node.js

## Supported Platforms
**This repo is under active development and is not production-ready. We will be
actively developing this in open source. Stay tuned for an official release.**

- Mac OS
- Linux
- Windows (not yet - TODO)
Currently, we only support developing TensorFlow.js code directly inside of this
repository, however we plan on publishing on NPM soon.

## Development
## Trying it out

- Prep:
```
$ yarn
```
```sh
# Download and install JS depencies, including libtensorflow 1.8.
yarn

- Run unit tests:
# Publish the NPM locally for usage with other packages.
yarn publish-local
```
$ yarn test

See the `demo` directory that trains MNIST using TensorFlow.js with the
TensorFlow C backend.

```sh
cd demo/
yarn

# Link the tfjs-node NPM we published above.
yarn link-local tfjs-node

# Run the training script. See demo/package.json for this script.
yarn mnist
```

- Run MNIST demo:
The important line to note is at the top of `mnist.ts`, which sets the backend to
TensorFlow.

```js
bindTensorFlowBackend();
```
$ yarn && yarn build && cd demo && yarn && yarn mnist


### Optional: Build libtensorflow From TensorFlow source

This requires installing bazel first.

```sh
bazel build //tensorflow/tools/lib_package:libtensorflow
```

## Supported Platforms

- Mac OS
- Linux
- ***Windows coming soon***
13 changes: 8 additions & 5 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@
"mnist": "ts-node src/mnist.ts",
"mnist-data": "ts-node src/mnist_data_demo.ts",
"build": "tsc",
"preinstall": "rm -rf ../node_modules && rm -rf node_modules"
"link-local": "yalc link"
},
"author": "",
"license": "ISC",
"dependencies": {
"devDependencies": {
"@types/node": "^9.4.6",
"@tensorflow/tfjs-core": "0.6.0",
"tfjs-node": "file:../.",
"ts-node": "^4.1.0",
"typescript": "^2.7.2"
"typescript": "^2.7.2",
"yalc": "~1.0.0-pre.21"
},
"dependencies": {
"@tensorflow/tfjs-core": "0.6.0",
"tfjs-node": "link:.yalc/tfjs-node"
}
}
Loading

0 comments on commit 8ae4c23

Please sign in to comment.