What is TensorFlow.js?
But wait, what is machine learning?
Machine learning is field of artificial intelligence (AI) which provides computers the ability to learn and improve the execution of tasks without any explicit instructions. Machine learning programs can access data and use it learn for themselves.
A ML program works by creating a model — much like a mathematical model, with various inputs and outputs. Models are fed with training data and “trains” itself by tweaking parameters of the model in order to minimize the amount of error of the model over time. In short, the program will change the model to try to make its output match the desired output.
Before there was Tensorflow.js, there was TensorFlow. Also developed by Google, TensorFlow is an open source machine learning framework built in C++. It combines a number of machine learning and deep learning models and algorithms. Tensorflow uses Python to provide a convenient front-end API for building applications while executing applications in C++.
What makes TensorFlow.js so useful?
Tensorflow.js allows the use of pre-trained models which means that developers new to machine learning, but want to integrate it into their projects can get started right away building applications — such as an audio recognition app — without having to put in the time necessary to train their own models. It allows machine learning to be more accessible than it previously was.
You can even use TensorFlow.js to retrain and tinker with pre-existing machine learning models with data only available client-side in the browser such as image or video data from a webcam. The opportunities are truly endless.
How to get started with TensorFlow.js
There are a number of online tutorials that can get you started with building applications using Tensorflow.js. Some of the best tutorials come from the official Tensorflow.js website itself at tensorflow.org/js/tutorials. Here you can learn how to build an image classifier, an app that can recognize hand drawn digits, among many other tutorials. Another great resource for getting started is this tutorial series from The Coding Train where he teaches the basics and takes his audience through the process of building a couple of regression models such as linear regression and polynomial regression.
Beginner Level Projects To Try
Build an image classifier: In building this project, you will learn both learn how to train your own custom image classifier and how to use a pre trained model for classification.
Create art: You can learn to make their own unique and beautiful works of art with the application of machine learning.
Implement real-time object detection: In this tutorial you will learn how to build a web app that can detect objects through the webcam.
Play games: While Artificial Intelligence in video games isn’t a new concept, TensorFlow.js enables beginners to make their first AI video game by teaching an AI to play pong inside the browser.
Now that I’ve convinced you of how useful and beginner-friendly that TensorFlow.js can be, I recommend that you create something with it. You will be pleasantly surprised about the outcome you can achieve in a short amount of time and I assure you that you will learn a lot in the process. If you run into any roadblocks during the creation of your project, refer to the official documentation and the several tutorials that are available online. Good luck!