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

Deep Learning with TensorFlow

Book Description

Delve into neural networks, implement deep learning algorithms, and explore layers of data abstraction with the help of this comprehensive TensorFlow guide

About This Book

  • Learn how to implement advanced techniques in deep learning with Google’s brainchild, TensorFlow
  • Explore deep neural networks and layers of data abstraction with the help of this comprehensive guide
  • Real-world contextualization through some deep learning problems concerning research and application

Who This Book Is For

The book is intended for a general audience of people interested in machine learning and machine intelligence. A rudimentary level of programming in one language is assumed, as is a basic familiarity with computer science techniques and technologies, including a basic awareness of computer hardware and algorithms. Some competence in mathematics is needed to the level of elementary linear algebra and calculus.

What You Will Learn

  • Learn about machine learning landscapes along with the historical development and progress of deep learning
  • Learn about deep machine intelligence and GPU computing with the latest TensorFlow 1.x
  • Access public datasets and utilize them using TensorFlow to load, process, and transform data
  • Use TensorFlow on real-world datasets, including images, text, and more
  • Learn how to evaluate the performance of your deep learning models
  • Using deep learning for scalable object detection and mobile computing
  • Train machines quickly to learn from data by exploring reinforcement learning techniques
  • Explore active areas of deep learning research and applications

In Detail

Deep learning is the step that comes after machine learning, and has more advanced implementations. Machine learning is not just for academics anymore, but is becoming a mainstream practice through wide adoption, and deep learning has taken the front seat. As a data scientist, if you want to explore data abstraction layers, this book will be your guide. This book shows how this can be exploited in the real world with complex raw data using TensorFlow 1.x.

Throughout the book, you’ll learn how to implement deep learning algorithms for machine learning systems and integrate them into your product offerings, including search, image recognition, and language processing. Additionally, you’ll learn how to analyze and improve the performance of deep learning models. This can be done by comparing algorithms against benchmarks, along with machine intelligence, to learn from the information and determine ideal behaviors within a specific context.

After finishing the book, you will be familiar with machine learning techniques, in particular the use of TensorFlow for deep learning, and will be ready to apply your knowledge to research or commercial projects.

Style and approach

This step-by-step guide will explore common, and not so common, deep neural networks and show how these can be exploited in the real world with complex raw data. With the help of practical examples, you will learn how to implement different types of neural nets to build smart applications related to text, speech, and image data processing.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

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 Deep Learning
    1. Introducing machine learning
      1. Supervised learning
      2. Unsupervised learning
      3. Reinforcement learning
    2. What is deep learning?
      1. How the human brain works
      2. Deep learning history
      3. Problems addressed
    3. Neural networks
      1. The biological neuron
      2. An artificial neuron
    4. How does an artificial neural network learn?
      1. The backpropagation algorithm
      2. Weights optimization
      3. Stochastic gradient descent
    5. Neural network architectures
      1. Multilayer perceptron
      2. DNNs architectures
      3. Convolutional Neural Networks
      4. Restricted Boltzmann Machines
    6. Autoencoders
    7. Recurrent Neural Networks
    8. Deep learning framework comparisons
    9. Summary
  3. First Look at TensorFlow
    1. General overview
      1. What's new with TensorFlow 1.x?
      2. How does it change the way people use it?
      3. Installing and getting started with TensorFlow
    2. Installing TensorFlow on Linux
      1. Which TensorFlow to install on your platform?
    3. Requirements for running TensorFlow with GPU from NVIDIA
      1. Step 1: Install NVIDIA CUDA
      2. Step 2: Installing NVIDIA cuDNN v5.1+
      3. Step 3: GPU card with CUDA compute capability 3.0+
      4. Step 4: Installing the libcupti-dev library
      5. Step 5: Installing Python (or Python3)
      6. Step 6: Installing and upgrading PIP (or PIP3)
      7. Step 7: Installing TensorFlow
    4. How to install TensorFlow
      1. Installing TensorFlow with native pip
      2. Installing with virtualenv
    5. Installing TensorFlow on Windows
      1. Installation from source
      2. Install on Windows
      3. Test your TensorFlow installation
    6. Computational graphs
    7. Why a computational graph?
      1. Neural networks as computational graphs
    8. The programming model
    9. Data model
      1. Rank
      2. Shape
      3. Data types
      4. Variables
      5. Fetches
      6. Feeds
    10. TensorBoard
      1. How does TensorBoard work?
    11. Implementing a single input neuron
    12. Source code for the single input neuron
    13. Migrating to TensorFlow 1.x
      1. How to upgrade using the script
      2. Limitations
      3. Upgrading code manually
      4. Variables
      5. Summary functions
      6. Simplified mathematical variants
      7. Miscellaneous changes
    14. Summary
  4. Using TensorFlow on a Feed-Forward Neural Network
    1. Introducing feed-forward neural networks
      1. Feed-forward and backpropagation
      2. Weights and biases
      3. Transfer functions
    2. Classification of handwritten digits
    3. Exploring the MNIST dataset
    4. Softmax classifier
      1. Visualization
    5. How to save and restore a TensorFlow model
      1. Saving a model
      2. Restoring a model
      3. Softmax source code
      4. Softmax loader source code
    6. Implementing a five-layer neural network
      1. Visualization
      2. Five-layer neural network source code
    7. ReLU classifier
    8. Visualization
      1. Source code for the ReLU classifier
    9. Dropout optimization
    10. Visualization
      1. Source code for dropout optimization
    11. Summary
  5. TensorFlow on a Convolutional Neural Network
    1. Introducing CNNs
    2. CNN architecture
      1. A model for CNNs - LeNet
    3. Building your first CNN
      1. Source code for a handwritten classifier
    4. Emotion recognition with CNNs
      1. Source code for emotion classifier
      2. Testing the model on your own image
      3. Source code
    5. Summary
  6. Optimizing TensorFlow Autoencoders
    1. Introducing autoencoders
    2. Implementing an autoencoder
      1. Source code for the autoencoder
    3. Improving autoencoder robustness
    4. Building a denoising autoencoder
      1. Source code for the denoising autoencoder
    5. Convolutional autoencoders
      1. Encoder
      2. Decoder
      3. Source code for convolutional autoencoder
    6. Summary
  7. Recurrent Neural Networks
    1. RNNs basic concepts
    2. RNNs at work
    3. Unfolding an RNN
    4. The vanishing gradient problem
    5. LSTM networks
    6. An image classifier with RNNs
      1. Source code for RNN image classifier
    7. Bidirectional RNNs
      1. Source code for the bidirectional RNN
    8. Text prediction
      1. Dataset
      2. Perplexity
      3. PTB model
      4. Running the example
    9. Summary
  8. GPU Computing
    1. GPGPU computing
    2. GPGPU history
    3. The CUDA architecture
    4. GPU programming model
    5. TensorFlow GPU set up
      1. Update TensorFlow
    6. TensorFlow GPU management
      1. Programming example
        1. Source code for GPU computation
    7. GPU memory management
    8. Assigning a single GPU on a multi-GPU system
      1. Source code for GPU with soft placement
    9. Using multiple GPUs
      1. Source code for multiple GPUs management
    10. Summary
  9. Advanced TensorFlow Programming
    1. Introducing Keras
      1. Installation
    2. Building deep learning models
    3. Sentiment classification of movie reviews
      1. Source code for the Keras movie classifier
    4. Adding a convolutional layer
      1. Source code for movie classifier with convolutional layer
    5. Pretty Tensor
      1. Chaining layers
        1. Normal mode
        2. Sequential mode
        3. Branch and join
    6. Digit classifier
      1. Source code for digit classifier
    7. TFLearn
      1. TFLearn installation
    8. Titanic survival predictor
      1. Source code for titanic classifier
    9. Summary
  10. Advanced Multimedia Programming with TensorFlow
    1. Introduction to multimedia analysis
    2. Deep learning for Scalable Object Detection
      1. Bottlenecks
      2. Using the retrained model
    3. Accelerated Linear Algebra
      1. Key strengths of TensorFlow
      2. Just-in-time compilation via XLA
        1. JIT compilation
        2. Existence and advantages of XLA
        3. Under the hood working of XLA
        4. Still experimental
        5. Supported platforms
        6. More experimental material
    4. TensorFlow and Keras
      1. What is Keras?
      2. Effects of having Keras on board
      3. Video question answering system
        1. Not runnable code!
    5. Deep learning on Android
      1. TensorFlow demo examples
      2. Getting started with Android
        1. Architecture requirements
        2. Prebuilt APK
        3. Running the demo
        4. Building with Android studio
        5. Going deeper - Building with Bazel
    6. Summary
  11. Reinforcement Learning
    1. Basic concepts of Reinforcement Learning
    2. Q-learning algorithm
    3. Introducing the OpenAI Gym framework
    4. FrozenLake-v0 implementation problem
      1. Source code for the FrozenLake-v0 problem
    5. Q-learning with TensorFlow
    6. Source code for the Q-learning neural network
    7. Summary