lapon.blogg.se

Npm tutorial for beginners
Npm tutorial for beginners










Then it predicts a $ y $ value for the unseen $ x $ value 20 and updates theĭOM to display the prediction. (y = 2x - 1)Ĭonst xs = tf.tensor2d(, ) Ĭonst ys = tf.tensor2d(, ) Generate some synthetic data for training. $ x $ and $ y $ values that satisfy the equation $ y = 2x - 1 $. The exact number will vary, but it should be close to 39. You should see a page title and beneath that a number like 38.31612014770508.

  • In the tfjs-examples/getting-started directory, run yarn watch.
  • Run the example and check out the results: element at the end of the body loads the machine learning script.įor other ways to take a dependency on TensorFlow.js, see the The element in the head loads the TensorFlow.js library, and the This is because the example loads TensorFlow.js from a CDN. If you look at the package.json file, you might notice that TensorFlow.js is
  • Change into the getting-started directory:.
  • Get the source code and install dependencies:

    npm tutorial for beginners

    To complete this tutorial, you need the following installed in your development To get started with TensorFlow.js by training a minimal model in the browser and

    npm tutorial for beginners

    Learning models in the web browser and in Node.js. TensorFlow.js is a JavaScript library for training and deploying machine












    Npm tutorial for beginners