Book Image

Hands-On Machine Learning on Google Cloud Platform

By : Giuseppe Ciaburro, V Kishore Ayyadevara, Alexis Perrier
Book Image

Hands-On Machine Learning on Google Cloud Platform

By: Giuseppe Ciaburro, V Kishore Ayyadevara, Alexis Perrier

Overview of this book

Google Cloud Machine Learning Engine combines the services of Google Cloud Platform with the power and flexibility of TensorFlow. With this book, you will not only learn to build and train different complexities of machine learning models at scale but also host them in the cloud to make predictions. This book is focused on making the most of the Google Machine Learning Platform for large datasets and complex problems. You will learn from scratch how to create powerful machine learning based applications for a wide variety of problems by leveraging different data services from the Google Cloud Platform. Applications include NLP, Speech to text, Reinforcement learning, Time series, recommender systems, image classification, video content inference and many other. We will implement a wide variety of deep learning use cases and also make extensive use of data related services comprising the Google Cloud Platform ecosystem such as Firebase, Storage APIs, Datalab and so forth. This will enable you to integrate Machine Learning and data processing features into your web and mobile applications. By the end of this book, you will know the main difficulties that you may encounter and get appropriate strategies to overcome these difficulties and build efficient systems.
Table of Contents (18 chapters)
8
Creating ML Applications with Firebase

Handwriting Recognition using RNN and TensorFlow

To practice RNNs, we will use the dataset previously used to construct the CNN. I refer to the MNIST dataset, a large database of handwritten digits. It has a set of 70,000 examples of data. It is a subset of NIST's larger dataset. Images of 28 x 28 pixel resolution are stored in a matrix of 70,000 rows and 785 columns; each pixel value from the 28 x 28 matrix and one value is the actual digit. In a fixed-size image, the digits have been size-normalized.

In this case, we will implement an RNN (LSTM) using the TensorFlow library to classify images. We will consider every image row as a sequence of pixels. Because the MNIST image shape is 28 x 28, we will handle 28 sequences of 28 time steps for every sample.

To start, we will analyze the code line by line; then we will see how to process it with the tools made available by...