Bundler
Hugo edited this page Jun 28, 2018
·
6 revisions
To get the project started quickly, each script was loaded in index.html
Using proper modules would widely improve the code but some change would have to be done
- For this I'm referring to the TensorFlow JS Website
Add TensorFlow.js to your project using yarn or npm. Note: Because we use ES2017 syntax (such as
import
), this workflow assumes you are using a bundler/transpiler to convert your code to something the browser understands.
- Using yarn or npm to install TensorflowJS
$ yarn add @tensorflow/tfjs
- Importing tfjs in javascript file (such as
neural_net.js
)
import * as tf from '@tensorflow/tfjs';