O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Machine Learning with TensorFlow 1.x

Book Description

Tackle common commercial machine learning problems with Google's TensorFlow 1.x library and build deployable solutions.

About This Book

  • Enter the new era of second-generation machine learning with Python with this practical and insightful guide
  • Set up TensorFlow 1.x for actual industrial use, including high-performance setup aspects such as multi-GPU support
  • Create pipelines for training and using applying classifiers using raw real-world data

Who This Book Is For

This book is for data scientists and researchers who are looking to either migrate from an existing machine learning library or jump into a machine learning platform headfirst. The book is also for software developers who wish to learn deep learning by example. Particular focus is placed on solving commercial deep learning problems from several industries using TensorFlow's unique features. No commercial domain knowledge is required, but familiarity with Python and matrix math is expected.

What You Will Learn

  • Explore how to use different machine learning models to ask different questions of your data
  • Learn how to build deep neural networks using TensorFlow 1.x
  • Cover key tasks such as clustering, sentiment analysis, and regression analysis using TensorFlow 1.x
  • Find out how to write clean and elegant Python code that will optimize the strength of your algorithms
  • Discover how to embed your machine learning model in a web application for increased accessibility
  • Learn how to use multiple GPUs for faster training using AWS

In Detail

Google's TensorFlow is a game changer in the world of machine learning. It has made machine learning faster, simpler, and more accessible than ever before. This book will teach you how to easily get started with machine learning using the power of Python and TensorFlow 1.x.

Firstly, you'll cover the basic installation procedure and explore the capabilities of TensorFlow 1.x. This is followed by training and running the first classifier, and coverage of the unique features of the library including data flow graphs, training, and the visualization of performance with TensorBoard - all within an example-rich context using problems from multiple industries. You'll be able to further explore text and image analysis, and be introduced to CNN models and their setup in TensorFlow 1.x. Next, you'll implement a complete real-life production system from training to serving a deep learning model. As you advance you'll learn about Amazon Web Services (AWS) and create a deep neural network to solve a video action recognition problem. Lastly, you'll convert the Caffe model to TensorFlow and be introduced to the high-level TensorFlow library, TensorFlow-Slim.

By the end of this book, you will be geared up to take on any challenges of implementing TensorFlow 1.x in your machine learning environment.

Style and approach

This comprehensive guide will enable you to understand the latest advances in machine learning and will empower you to implement this knowledge in your machine learning environment.

Table of Contents

  1. Preface
    1. What this book covers
    2. What you need for this book
    3. Who this book is for
    4. Conventions
    5. Reader feedback
    6. Customer support
      1. Downloading the example code
      2. Downloading the color images of this book
      3. Errata
      4. Piracy
      5. Questions
  2. Getting Started with TensorFlow
    1. Current use
    2. Installing TensorFlow
      1. Ubuntu installation
      2. macOS installation
      3. Windows installation
      4. Virtual machine setup
      5. Testing the installation
    3. Summary
  3. Your First Classifier
    1. The key parts
    2. Obtaining training data
    3. Downloading training data
    4. Understanding classes
      1. Automating the training data setup
    5. Additional setup
      1. Converting images to matrices
    6. Logical stopping points
    7. The machine learning briefcase
    8. Training day
    9. Saving the model for ongoing use
    10. Why hide the test set?
    11. Using the classifier
    12. Deep diving into the network
    13. Skills learned
    14. Summary
  4. The TensorFlow Toolbox
    1. A quick preview
    2. Installing TensorBoard
      1. Incorporating hooks into our code
        1. Handwritten digits
      2. AlexNet
    3. Automating runs
    4. Summary
  5. Cats and Dogs
    1. Revisiting notMNIST
      1. Program configurations
      2. Understanding convolutional networks
      3. Revisiting configurations
      4. Constructing the convolutional network
      5. Fulfilment
    2. Training day
    3. Actual cats and dogs
    4. Saving the model for ongoing use
    5. Using the classifier
    6. Skills learned
    7. Summary
  6. Sequence to Sequence Models-Parlez-vous Français?
    1. A quick preview
    2. Drinking from the firehose
    3. Training day
    4. Summary
  7. Finding Meaning
    1. Additional setup
    2. Skills learned
    3. Summary
  8. Making Money with Machine Learning
    1. Inputs and approaches
      1. Getting the data
    2. Approaching the problem
      1. Downloading and modifying data
      2. Viewing the data
      3. Extracting features
      4. Preparing for training and testing
      5. Building the network
      6. Training
      7. Testing
    3. Taking it further
    4. Practical considerations for the individual
    5. Skills learned
    6. Summary
  9. The Doctor Will See You Now
    1. The challenge
    2. The data
    3. The pipeline
      1. Understanding the pipeline
      2. Preparing the dataset
      3. Explaining the data preparation
      4. Training routine
      5. Validation routine
      6. Visualize outputs with TensorBoard
        1. Inception network
    4. Going further
      1. Other medical data challenges
      2. The ISBI grand challenge
      3. Reading medical data
    5. Skills Learned
    6. Summary
  10. Cruise Control - Automation
    1. An overview of the system
    2. Setting up the project
    3. Loading a pre-trained model to speed up the training
      1. Testing the pre-trained model
    4. Training the model for our dataset
      1. Introduction to the Oxford-IIIT Pet dataset
        1. Dataset Statistics
        2. Downloading the dataset
        3. Preparing the data
      2. Setting up input pipelines for training and testing
      3. Defining the model
      4. Defining training operations
      5. Performing the training process
      6. Exporting the model for production
    5. Serving the model in production
      1. Setting up TensorFlow Serving
      2. Running and testing the model
      3. Designing the web server
        1. Testing the system
    6. Automatic fine-tune in production
      1. Loading the user-labeled data
      2. Performing a fine-tune on the model
      3. Setting up cronjob to run every day
    7. Summary
  11. Go Live and Go Big
    1. Quick look at Amazon Web Services
      1. P2 instances
      2. G2 instances
      3. F1 instances
      4. Pricing
    2. Overview of the application
      1. Datasets
      2. Preparing the dataset and input pipeline
        1. Pre-processing the video for training
        2. Input pipeline with RandomShuffleQueue
      3. Neural network architecture
      4. Training routine with single GPU
      5. Training routine with multiple GPU
    3. Overview of Mechanical Turk
    4. Summary
  12. Going Further - 21 Problems
    1. Dataset and challenges
      1. Problem 1 - ImageNet dataset
      2. Problem 2 - COCO dataset
      3. Problem 3 - Open Images dataset
      4. Problem 4 - YouTube-8M dataset
      5. Problem 5 - AudioSet dataset
      6. Problem 6 - LSUN challenge
      7. Problem 7 - MegaFace dataset
      8. Problem 8 - Data Science Bowl 2017 challenge
      9. Problem 9 - StarCraft Game dataset
    2. TensorFlow-based Projects
      1. Problem 10 - Human Pose Estimation
      2. Problem 11 - Object Detection - YOLO
      3. Problem 12 - Object Detection - Faster RCNN
      4. Problem 13 - Person Detection - tensorbox
      5. Problem 14 - Magenta
      6. Problem 15 - Wavenet
      7. Problem 16 - Deep Speech
    3. Interesting Projects
      1. Problem 17 - Interactive Deep Colorization - iDeepColor
      2. Problem 18 - Tiny face detector
      3. Problem 19 - People search
      4. Problem 20 - Face Recognition - MobileID
      5. Problem 21 - Question answering - DrQA
    4. Caffe to TensorFlow
    5. TensorFlow-Slim
    6. Summary
  13. Advanced Installation
    1. Installation
      1. Installing Nvidia driver
      2. Installing the CUDA toolkit
      3. Installing cuDNN
      4. Installing TensorFlow
      5. Verifying TensorFlow with GPU support
    2. Using TensorFlow with Anaconda
    3. Summary