Machine Learning with TensorFlow, Second Edition
Chris A. Mattmann
  • MEAP began January 2020
  • Publication in Spring 2021 (estimated)
  • ISBN 9781617297717
  • 472 pages (estimated)
  • printed in black & white
free previous edition eBook included
An eBook copy of the previous edition of this book is included at no additional cost. It will be automatically added to your Manning Bookshelf within 24 hours of purchase.

Chris Mattmann has done a colossal and commendable job: I highly recommend it.

Alain Lompo
Updated with new code, new projects, and new chapters, Machine Learning with TensorFlow, Second Edition gives readers a solid foundation in machine-learning concepts and the TensorFlow library. Written by NASA JPL Deputy CTO and Principal Data Scientist Chris Mattmann, all examples are accompanied by downloadable Jupyter Notebooks for a hands-on experience coding TensorFlow with Python. New and revised content expands coverage of core machine learning algorithms, and advancements in neural networks such as VGG-Face facial identification classifiers and deep speech classifiers.

About the Technology

TensorFlow, Google’s library for large-scale machine learning, makes powerful ML techniques easily accessible. It simplifies often-complex computations by representing them as graphs that are mapped to machines in a cluster or to the processors of a single machine. Offering a complete ecosystem for all stages and types of machine learning, TensorFlow’s end-to-end functionality empowers machine learning engineers of all skill levels to solve their problems with ML.

About the book

This fully revised second edition of Machine Learning with TensorFlow teaches you the foundational concepts of machine learning, and how to utilize the TensorFlow library to rapidly build powerful ML models. You'll learn the basics of regression, classification, and clustering algorithms, applying them to solve real-world challenges such as call center volume prediction and sentiment analysis of movie reviews. Once you’ve mastered core ML concepts, you'll move on to the money chapters: exploring cutting-edge neural network techniques such as deep speech classifiers, facial identification, and auto-encoding with CIFAR-10. Plus, in all-new appendices you'll cover updating your code to TensorFlow 2.0, and much-needed techniques for running your code inside Docker containers. Digest this book, and you'll be able to start modelling your everyday problems as automated machine learning tasks.
Table of Contents detailed table of contents


1 A machine-learning odyssey

1.1 Machine-learning fundamentals

1.1.1 Parameters

1.1.2 Learning and inference

1.2 Data representation and features

1.3 Distance metrics

1.4 Types of learning

1.4.1 Supervised learning

1.4.2 Unsupervised learning

1.4.3 Reinforcement learning

1.4.4 Meta-learning

1.5 TensorFlow

1.6 Overview of future chapters

1.7 Summary

2 TensorFlow essentials

2.1 Ensuring that TensorFlow works

2.2 Representing tensors

2.3 Creating operators

2.4 Executing operators with sessions

2.5 Understanding code as a graph

2.5.1 Setting session configurations

2.6 Writing code in Jupyter

2.7 Using variables

2.8 Saving and loading variables

2.9 Visualizing data using TensorBoard

2.9.1 Implementing a moving average

2.9.2 Visualizing the moving average

2.10 Putting it all together: The TensorFlow System Architecture and. API

2.11 Summary


3 Linear regression and beyond

3.1 Formal notation

3.1.1 How do you know the regression algorithm is working?

3.2 Linear regression

3.3 Polynomial model

3.4 Regularization

3.5 Application of linear regression

3.6 Summary

4 Using regression for call center volume prediction

4.1 What is 3-1-1?

4.2 Cleaning the data for regression

4.3 What’s in a bell curve: predicting Gaussian distributions

4.4 Training your call prediction regressor

4.5 Visualizing the results and plotting the error

4.6 Regularization and train test splits

4.7 Summary

5 A gentle introduction to classification

5.1 Formal notation

5.2 Measuring performance

5.2.1 Accuracy

5.2.2 Precision and recall

5.2.3 Receiver operating characteristic curve

5.3 Using linear regression for classification

5.4 Using logistic regression

5.4.1 Solving one-dimensional logistic regression

5.4.2 Solving two-dimensional logistic regression

5.5 Multiclass classifier

5.5.1 One-versus-all

5.5.2 One-versus-one

5.5.3 Softmax regression

5.6 Application of classification

5.7 Summary

6 Sentiment classification: large movie review dataset

6.1 The Bag of Words model

6.1.1 Applying the Bag of Words model to Movie Reviews

6.1.2 Cleaning all the movie reviews

6.1.3 Exploratory Data Analysis on your Bag of Words

6.2 Building a sentiment classifier using logistic regression

6.2.1 Setting up the training for your model

6.2.2 Performing the training for your model

6.3 Making predictions using your sentiment classifier

6.4 Measuring the effectiveness of your classifier

6.5 Creating the softmax-regression sentiment classifier

6.6 Submit your results to Kaggle

6.7 Summary

7 Automatically clustering data

7.1 Traversing files in TensorFlow

7.2 Extracting features from audio

7.3 K-means clustering

7.4 Audio segmentation

7.5 Clustering using a self-organizing map

7.6 Application of clustering

7.7 Summary

8 Inferring user activity from Android accelerometer data

8.1 The user activity from walking dataset

8.1.1 Creating the dataset

8.1.2 Computing jerk and extracting the feature vector

8.2 Clustering similar participants based on jerk magnitudes

8.3 Different classes of user activity for a single participant: climbing, standing, walking, talking, and working

8.4 Summary

9 Hidden Markov models

9.1 Example of a not-so-interpretable model

9.2 Markov model

9.3 Hidden Markov model

9.4 Forward algorithm

9.5 Viterbi decoding

9.6 Uses of hidden Markov models

9.6.1 Modeling a video

9.6.2 Modeling DNA

9.6.3 Modeling an image

9.7 Application of hidden Markov models

9.8 Summary

10 Part of speech tagging and word sense disambiguation

10.1 Review the HMM example: rainy or sunny and what it’s actually doing

10.2 Part-of-speech tagging

10.2.1 The big picture: training and predicting PoS with HMMs

10.2.2 Generating the ambiguity PoS tagged dataset

10.3 Algorithms for building the Hidden Markov Model for PoS disamguiation

10.3.1 Generating the emission probabilities

10.4 Running the HMM and evaluating its output

10.5 Getting more training data using the Brown corpus

10.6 Defining error bars and metrics for PoS tagging

10.7 Summary


11 A peek into autoencoders

11.1 Neural networks

11.2 Autoencoders

11.3 Batch training

11.4 Working with images

11.5 Application of autoencoders

11.6 Summary

12 Applying autoencoders: the CIFAR-10 image dataset

12.1 What is CIFAR-10

12.1.1 Evaluating your CIFAR-10 Autoencoder

12.2 Autoencoders as classifiers

12.2.1 Using the Autoencoder as a classifier via loss

12.3 De-noising autoencoders

12.4 Stacked deep autoencoders

12.5 Summary

13 Reinforcement learning

13.1 Formal Notions

13.1.1 Policy

13.1.2 Utility

13.2 Applying reinforcement learning

13.3 Implementing reinforcement learning

13.4 Exploring other applications of reinforcement learning

13.5 Summary

14 Convolutional neural networks

14.1 Drawback of neural networks

14.2 Convolutional neural networks

14.3 Preparing the image

14.3.1 Generating filters

14.3.2 Convolving using filters

14.3.3 Max pooling

14.4 Implementing a convolutional neural network in TensorFlow

14.4.1 Measuring performance

14.4.2 Training the classifier

14.5 Tips and tricks to improve performance

14.6 Application of convolutional neural networks

14.7 Summary

15 Building a real-world CNN: VGG-Face and VGG-Face Lite

15.1 Making a real-world CNN architecture for CIFAR-10

15.1.1 Loading and preparing the CIFAR-10 image data

15.1.2 Data augmentation

15.2 Building a deeper CNN architecture for CIFAR-10

15.2.1 CNN optimizations for increasing learned parameter resilience

15.3 Training and applying a better CIFAR-10 CNN

15.4 Testing and evaluating your CNN for CIFAR-10

15.4.1 CIFAR-10 accuracy results and ROC curves

15.4.2 Evaluating the softmax predictions per class

15.5 Building VGG-Face for Facial Recognition

15.5.1 Picking a subset of VGG-Face for training VGG-Face Lite

15.5.2 TensorFlow’s Dataset API and data augmentation

15.5.3 Creating a TensorFlow Dataset

15.5.4 Training using TensorFlow datasets

15.5.5 VGG Face lite model and training

15.5.6 Training and evaluating VGG Face lite

15.5.7 Evaluating and predicting with VGG Face lite

15.6 Summary

16 Recurrent neural networks

16.1 Introduction to recurrent neural networks

16.2 Implementing a recurrent neural network

16.3 A predictive model for time-series data

16.4 Application of recurrent neural networks

16.5 Summary

17 LSTMs and automatic speech recognition

17.1 Preparing the LibriSpeech corpus

17.1.1 Downloading, cleaning, and preparing LibriSpeech OpenSLR data

17.1.2 Converting the audio

17.1.3 Generating per audio transcripts

17.1.4 Aggregating audio and transcripts

17.2 The deep-speech model

17.2.1 Preparing the input audio data for deep speech

17.2.2 Preparing the text transcripts into character level numerical data

17.2.3 The deep-speech model in TensorFlow

17.2.4 Connectionist temporal classification in TensorFlow

17.3 Training deep speech and evaluating it

17.4 Summary

18 Sequence-to-sequence models for chatbots

18.1 Building on classification and RNNs

18.2 Seq2seq architecture

18.3 Vector representation of symbols

18.4 Putting it all together

18.5 Gathering dialogue data

18.6 Summary

19 Utility landscape

19.1 Preference model

19.2 Image embedding

19.3 Ranking images

19.4 Summary

19.5 What’s next


Appendix A: Installation instructions

A.1 Installing the book’s code using Docker

A.1.1 Installing Docker on Windows

A.1.2 Installing Docker on Linux

A.1.3 Installing Docker on macOS

A.1.4 How to use Docker

A.2 Getting the data and storing models

A.3 Necessary libraries

A.4 Converting the call center example to TensorFlow2

A.4.1 The call center example using TF2

What's inside

  • Matching your tasks to the right machine-learning or deep-learning approach
  • Visualizing algorithms with TensorBoard
  • Sharing your results with collaborators using other frameworks
  • Understanding and using neural networks
  • Reproducing and employing predictive science
  • Downloadable Jupyter Notebooks for all examples
  • Questions to test your knowledge
  • Examples use the super-stable 1.14.1 branch of TensorFlow
  • Techniques to reuse TensorFlow 1.0 code in TensorFlow 2.x

About the reader

Written for developers experienced with Python and algebraic concepts like vectors and matrices.

About the author

Chris Mattmann is the Deputy Chief Technology and Innovation Officer at NASA Jet Propulsion Lab, where he has been recognised as JPL's first Principal Scientist in the area of Data Science. Chris has applied TensorFlow to challenges he’s faced at NASA, including building an implementation of Google’s Show & Tell algorithm for image captioning using TensorFlow. He contributes to open source as a former Director at the Apache Software Foundation, and teaches graduate courses at USC in Content Detection and Analysis, and in Search Engines and Information Retrieval.

Nishant Shukla wrote the first edition of Machine Learning with TensorFlow.

placing your order...

Don't refresh or navigate away from the page.
Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
print book $24.99 $49.99 pBook + eBook + liveBook
includes previous edition eBook
Additional shipping charges may apply
Machine Learning with TensorFlow, Second Edition (print book) added to cart
continue shopping
go to cart

eBook $19.99 $39.99 3 formats + liveBook
includes previous edition eBook
Machine Learning with TensorFlow, Second Edition (eBook) added to cart
continue shopping
go to cart

Prices displayed in rupees will be charged in USD when you check out.
customers also reading

This book 1-hop 2-hops 3-hops

FREE domestic shipping on three or more pBooks