How To Write Your First Web-Based Machine Learning Model With TensorFlow.JS

How To Write Your First Web-Based Machine Learning Model With TensorFlow.JS

In this article, you’ll learn TensorFlow.js and how to build a web-based machine learning model using TensorFlow.js.

To get started, you should:

  • Have an idea of what machine learning is, or learn it by reading Introduction To Machine Learning.
  • Have basic knowledge of HTML
  • Have basic knowledge of Javascript data types, functions, objects, and event handling.

TensorFlow.js is an open-source Javascript library for training and deploying machine learning models on the browser. TensorFlow.js is owned by Google and is written in C++.

TensorFlow.js is the browser-based version of TensorFlow which is a free and open-source software library for dataflow and differentiable programming across a range of tasks. It is a symbolic math library and is also used for machine learning applications such as neural networks.

Getting Started

Installing TensorFlow.js

  • Create your HTML page
<html>
  <head>
    <title>My TensorFlow Page</title>
  </head>
  <body>
    <div id="content">

    </div>
  </body>
</html>

Since TensorFlow.js is a Javascript library, there are two ways of installing it:

  • Using the