Book Image

Machine Learning for Mobile

By : Revathi Gopalakrishnan, Avinash Venkateswarlu
Book Image

Machine Learning for Mobile

By: Revathi Gopalakrishnan, Avinash Venkateswarlu

Overview of this book

Machine learning presents an entirely unique opportunity in software development. It allows smartphones to produce an enormous amount of useful data that can be mined, analyzed, and used to make predictions. This book will help you master machine learning for mobile devices with easy-to-follow, practical examples. You will begin with an introduction to machine learning on mobiles and grasp the fundamentals so you become well-acquainted with the subject. You will master supervised and unsupervised learning algorithms, and then learn how to build a machine learning model using mobile-based libraries such as Core ML, TensorFlow Lite, ML Kit, and Fritz on Android and iOS platforms. In doing so, you will also tackle some common and not-so-common machine learning problems with regard to Computer Vision and other real-world domains. By the end of this book, you will have explored machine learning in depth and implemented on-device machine learning with ease, thereby gaining a thorough understanding of how to run, create, and build real-time machine-learning applications on your mobile devices.
Table of Contents (19 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Question and Answers
Index

Writing the mobile application using the TensorFlow model


What we are going to do?

In this section, we are going to build a small (a+b)2 model in TensorFlow, deploy it into an android mobile application, and run it from the Android mobile device.

What do you need to know?

To proceed in this section, you need a working installation of Python, TensorFlow dependencies, and android studio, and also some knowledge of python and java android. You can find the instructions on how to install TensorFlow here: https://www.tensorflow.org/install/.

If you need a detailed installation procedure for Windows, please refer to the one provided with screenshots in the Chapter 11, The Future of ML on Mobile Applications of this book.

We saw the details of TensorFlow already. To put it onto a simple words TensorFlow is nothing but saving the tensor flow program written in python into a small file that can be read by the C++ native libraries what we will install in our Android app and can execute and do the inference...