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

TensorFlow for Machine Intelligence

Book Description

This book is a hands-on introduction to learning algorithms. It is for people who may know a little machine learning (or not) and who may have heard about TensorFlow, but found the documentation too daunting to approach. The learning curve is gentle and you always have some code to illustrate the math step-by-step. TensorFlow, a popular library for machine learning, embraces the innovation and community-engagement of open source, but has the support, guidance, and stability of a large corporation. Because of its multitude of strengths, TensorFlow is appropriate for individuals and businesses ranging from startups to companies as large as, well, Google. TensorFlow is currently being used for natural language processing, artificial intelligence, computer vision, and predictive analytics. TensorFlow, open sourced to the public by Google in November 2015, was made to be flexible, efficient, extensible, and portable. Computers of any shape and size can run it, from smartphones all the way up to huge computing clusters. This book starts with the absolute basics of TensorFlow. We found that most tutorials on TensorFlow start by attempting to teach both machine learning concepts and TensorFlow terminology at the same time. Here we first make sure you've had the opportunity to become comfortable with TensorFlow's mechanics and core API before covering machine learning concepts.

Table of Contents

  1. Preface
    1. Welcome
    2. Background education
      1. What you should expect to learn
    3. This book’s layout
      1. Section 1: Getting started with TensorFlow
      2. Section 2: TensorFlow and Machine Learning fundamentals
      3. Section 3: Implementing advanced deep models in TensorFlow
      4. Section 4: Additional tips, techniques, and features
    4. Other machine learning libraries
  2. I. Getting started with TensorFlow
  3. 1. Introduction
    1. Data is everywhere
    2. Deep learning
    3. TensorFlow: a modern machine learning library
    4. TensorFlow: a technical overview
      1. A brief history of deep learning at Google
    5. What is TensorFlow?
      1. Breaking down the one-sentence description
      2. Beyond the one-sentence description
    6. When to use TensorFlow
    7. TensorFlow’s strengths
    8. Challenges when using TensorFlow
    9. Onwards and upwards!
  4. 2. TensorFlow Installation
    1. Selecting an installation environment
    2. Jupyter Notebook and Matplotlib
    3. Creating a Virtualenv environment
    4. Simple installation of TensorFlow
    5. Example installation from source: 64-bit Ubuntu Linux with GPU support
      1. Installing dependencies
      2. Installing Bazel
      3. Installing CUDA Software (NVIDIA CUDA GPUs only)
      4. Building and Installing TensorFlow from Source
    6. Installing Jupyter Notebook:
    7. Installing matplotlib
    8. Testing Out TensorFlow, Jupyter Notebook, and matplotlib
    9. Conclusion
  5. II. TensorFlow and Machine Learning fundamentals
  6. 3. TensorFlow Fundamentals
    1. Introduction to Computation Graphs
      1. Graph basics
      2. Dependencies
    2. Defining Computation Graphs in TensorFlow
      1. Building your first TensorFlow graph
      2. Thinking with tensors
      3. Tensor shape
      4. TensorFlow operations
      5. TensorFlow graphs
      6. TensorFlow Sessions
      7. Adding Inputs with Placeholder nodes
      8. Variables
    3. Organizing your graph with name scopes
    4. Logging with TensorBoard
    5. Exercise: Putting it together
      1. Building the graph
      2. Running the graph
    6. Conclusion
  7. 4. Machine Learning Basics
    1. Supervised learning introduction
    2. Saving training checkpoints
    3. Linear regression
    4. Logistic regression
    5. Softmax classification
    6. Multi-layer neural networks
    7. Gradient descent and backpropagation
  8. III. Implementing Advanced Deep Models in TensorFlow
  9. 5. Object Recognition and Classification
    1. Convolutional Neural Networks
    2. Convolution
      1. Input and Kernel
      2. Strides
      3. Padding
      4. Data Format
      5. Kernels in Depth
    3. Common Layers
      1. Convolution Layers
      2. Activation Functions
      3. Pooling Layers
      4. Normalization
      5. High Level Layers
    4. Images and TensorFlow
      1. Loading images
      2. Image Formats
      3. Image Manipulation
      4. Colors
    5. CNN Implementation
      1. Stanford Dogs Dataset
      2. Convert Images to TFRecords
      3. Load Images
      4. Model
      5. Training
      6. Debug the Filters with Tensorboard
    6. Conclusion
  10. 6. Recurrent Neural Networks and Natural Language Processing
    1. Introduction to Recurrent Networks
      1. We live in a Temporal World
      2. Approximating Arbitrary Programs
      3. Backpropagation Through Time
      4. Encoding and Decoding Sequences
      5. Implementing Our First Recurrent Network
      6. Vanishing and Exploding Gradients
      7. Long-Short Term Memory
      8. Architecture Variations
    2. Word Vector Embeddings
      1. Preparing the Wikipedia Corpus
      2. Model structure
      3. Noise Contrastive Classifier
      4. Training the model
    3. Sequence Classification
      1. Imdb Movie Review Dataset
      2. Using the Word Embeddings
      3. Sequence Labelling Model
      4. Softmax from last relevant activation
      5. Gradient clipping
      6. Training the model
    4. Sequence Labelling
      1. Optical Character Recognition Dataset
      2. Softmax shared between time steps
      3. Training the Model
      4. Bidirectional RNNs
    5. Predictive coding
      1. Character-level language modelling
      2. ArXiv abstracts API
      3. Preprocessing the data
      4. Predictive coding model
      5. Training the model
      6. Generating similiar sequences
    6. Conclusion
  11. IV. Additional Tips, Techniques, and Features
  12. 7. Deploying Models in Production
    1. Setting up a Tensorflow serving development environment
      1. Bazel workspace
    2. Exporting trained models
    3. Defining a server interface
    4. Implementing an inference server
    5. The client app
    6. Preparing for production
  13. 8. Helper Functions, Code Structure, and Classes
    1. Ensure a directory structure
    2. Download function
    3. Disk caching decorator
    4. Attribute Dictionary
    5. Lazy property decorator
    6. Overwrite Graph Decorator
  14. 9. Conclusion
    1. Next steps and additional resources
      1. Read the docs
      2. Stay Updated
      3. Distributed TensorFlow
      4. Building New TensorFlow Functionality
      5. Get involved with the community
      6. Code from this book