Charlie Gerard

Practical Machine Learning in JavaScript

TensorFlow.js for Web Developers

1st ed.
Charlie Gerard
Les Clayes sous bois, France
ISBN 978-1-4842-6417-1e-ISBN 978-1-4842-6418-8
Apress standard
© Charlie Gerard 2021
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Distributed to the book trade worldwide by Springer Science+Business Media New York,1 NY Plazar, New York, NY 10014. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.

To Joel, Jack and Daisy, just because. To me, for pushing through a very tough year and still doing my best writing this book.

Introduction

Even though machine learning (ML) isn’t a new technology, improvements in techniques and algorithms over the past few years have brought it to the forefront of technology, making it possibly one of the most exciting and promising tool to solve complex problems.

In general, most production machine learning applications are developed using programming languages such as Python or R, by researchers, machine learning engineers and data scientist; however, in recent years, new tools have been built in the aim to make machine learning more accessible to a wider range of developers.

In this book, we will focus on TensorFlow.js, a multi-features JavaScript library developed by Google that empowers web developers to build ML-enabled applications in the browser or in Node.js.

You might be thinking: “Why would I read a book about machine learning in JavaScript if most ML-enabled applications use Python or R in production?”, or, “Why would I learn about machine learning if I am a web developer?”. These questions are valid, especially considering that machine learning is a very different discipline than web development. However, in the technology field, a part of our work is to keep up to date with what is going on, not necessarily becoming an expert at every new technology or tool, but at least have an idea of the possibilities and limits. In my opinion, this is why tools like TensorFlow.js are important. Having the possibility to explore a new topic without having to also learn another programming language breaks down the barrier considerably. Besides, considering how fast things are moving and how powerful these tools are 13 becoming, we can imagine a future where “JavaScript machine learning engineer” would be a sought-after job title. After all, I would have never imagined “Futurist” would be one.

All this to say that the aim of this book is to introduce machine learning in a more approachable way, to break down barriers and hopefully make you feel more comfortable with this technology. After reading, you should have a good understanding of the current features offered by machine learning frameworks in JavaScript. To do this, we’ll define some of the commonly used terms and concepts you will open come across, we’ll cover the basics of ML using TensorFlow.js, and we’ll build a variety of projects to understand what is currently possible as well as some of the pitfalls. By the end, you should be able to, not only understand the theory, but also build machine learning enabled web applications.

An important thing to note however, is that this book is not going to look into how different machine learning algorithms are being developed. We’re not going to dive into their source code, but instead, learn to identify their use cases and how to implement them. This book is aimed at being an introduction for people who want to learn more about machine learning in a practical way, without getting too deep into advanced topics.

Finally, and more importantly, I wanted to make this book as engaging as possible, so the different projects you will build involve various inputs such as images, the video from your webcam feed, the audio from your computer’s microphone, text data you can replace, and even motion data!

Machine learning can be fun so, if this sounds interesting to you, I hope you’ll like this book.

Acknowledgments

First of all, thanks to everyone involved in the creation of this book, including my publisher, my editor and my technical reviewers, for giving me this opportunity. Additionally, thanks to the TensorFlow.js team for creating the framework this book relies on. Their work and dedication to make machine learning more accessible to web developers has been essential to my research and work over the past couple of years. Finally, special thanks to my close friends for their constant support throughout the years and to the community of people who have been following my work and sharing my passion for creating useless (but not worthless) projects. This would not have been possible without you and I am forever grateful.

Table of Contents
Index 317
About the Author
Charlie Gerard

is a senior front-end developer at Netlify, a Google Developer Expert in Web Technologies, and a Mozilla Tech Speaker. She is passionate about exploring the possibilities of the Web and spends her personal time building interactive prototypes using hardware, creative coding, and machine learning. She has been diving into ML in JavaScript for over a year and built a variety of projects. She’s excited to share what she’s learned and help more developers get started.

 
About the Technical Reviewer
David Pazmino

has been developing software applications for 20 years in Fortune 100 companies. He is an experienced developer in front-end and back-end development who specializes in developing machine learning models for financial applications. David has developed many applications in Node.js, Angular.js, and React.js. He currently develops applications in Scala and Python for deep learning neural networks using TensorFlow 2.0. David has a degree from Cornell University, a master’s from Pace University in Computer Science, and a master’s from Northwestern in Predictive Analytics.

 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.62.45