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 Machine Learning Cookbook - Second Edition

Book Description

Skip the theory and get the most out of Tensorflow to build production-ready machine learning models

Key Features

  • Exploit the features of Tensorflow to build and deploy machine learning models
  • Train neural networks to tackle real-world problems in Computer Vision and NLP
  • Handy techniques to write production-ready code for your Tensorflow models

Book Description

TensorFlow is an open source software library for Machine Intelligence. The independent recipes in this book will teach you how to use TensorFlow for complex data computations and allow you to dig deeper and gain more insights into your data than ever before.

With the help of this book, you will work with recipes for training models, model evaluation, sentiment analysis, regression analysis, clustering analysis, artificial neural networks, and more. You will explore RNNs, CNNs, GANs, reinforcement learning, and capsule networks, each using Google's machine learning library, TensorFlow. Through real-world examples, you will get hands-on experience with linear regression techniques with TensorFlow. Once you are familiar and comfortable with the TensorFlow ecosystem, you will be shown how to take it to production.

By the end of the book, you will be proficient in the field of machine intelligence using TensorFlow. You will also have good insight into deep learning and be capable of implementing machine learning algorithms in real-world scenarios.

What you will learn

  • Become familiar with the basic features of the TensorFlow library
  • Get to know Linear Regression techniques with TensorFlow
  • Learn SVMs with hands-on recipes
  • Implement neural networks to improve predictive modeling
  • Apply NLP and sentiment analysis to your data
  • Master CNN and RNN through practical recipes
  • Implement the gradient boosted random forest to predict housing prices
  • Take TensorFlow into production

Who this book is for

If you are a data scientist or a machine learning engineer with some knowledge of linear algebra, statistics, and machine learning, this book is for you. If you want to skip the theory and build production-ready machine learning models using Tensorflow without reading pages and pages of material, this book is for you. Some background in Python programming is assumed.

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 files e-mailed directly to you.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. TensorFlow Machine Learning Cookbook Second Edition
  3. Dedication
  4. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  5. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Conventions used
    4. Sections
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Get in touch
      1. Reviews
  7. Getting Started with TensorFlow
    1. Introduction
    2. How TensorFlow works
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Declaring variables and tensors
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Using placeholders and variables
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Working with matrices
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Declaring operations
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Implementing activation functions
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    8. Working with data sources
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    9.  Additional resources
      1. Getting ready
      2. How to do it...
  8. The TensorFlow Way
    1. Introduction
    2. Operations in a computational graph
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Layering nested operations
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Working with multiple layers
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Implementing loss functions
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    6. Implementing backpropagation
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. Working with batch and stochastic training
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    8. Combining everything together
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    9. Evaluating models
      1. Getting ready
      2. How to do it...
      3. How it works...
  9. Linear Regression
    1. Introduction
    2. Using the matrix inverse method
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Implementing a decomposition method
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Learning the TensorFlow way of linear regression
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Understanding loss functions in linear regression
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    6. Implementing deming regression
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Implementing lasso and ridge regression
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    8. Implementing elastic net regression
      1. Getting ready
      2. How to do it...
      3. How it works...
    9. Implementing logistic regression
      1. Getting ready
      2. How to do it...
      3. How it works...
  10. Support Vector Machines
    1. Introduction
    2. Working with a linear SVM
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Reduction to linear regression
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Working with kernels in TensorFlow
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Implementing a non-linear SVM
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Implementing a multi-class SVM
      1. Getting ready
      2. How to do it...
      3. How it works...
  11. Nearest-Neighbor Methods
    1. Introduction
    2. Working with nearest-neighbors
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Working with text based distances
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Computing with mixed distance functions
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Using an address matching example
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Using nearest-neighbors for image recognition
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  12. Neural Networks
    1. Introduction
    2. Implementing operational gates
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Working with gates and activation functions
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Implementing a one-layer neural network
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Implementing different layers
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Using a multilayer neural network
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Improving the predictions of linear models
      1. Getting ready
      2. How to do it
      3. How it works...
    8. Learning to play Tic Tac Toe
      1. Getting ready
      2. How to do it...
      3. How it works...
  13. Natural Language Processing
    1. Introduction
    2. Working with bag-of-words embeddings
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Implementing TF-IDF
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Working with Skip-Gram embeddings
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Working with CBOW embeddings
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    6. Making predictions with word2vec
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Using doc2vec for sentiment analysis
      1. Getting ready
      2. How to do it...
      3. How it works...
  14. Convolutional Neural Networks
    1. Introduction
    2. Implementing a simple CNN
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Implementing an advanced CNN
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    4. Retraining existing CNN models
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    5. Applying stylenet and the neural-style project
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    6. Implementing DeepDream
      1. Getting ready
      2. How to do it...
      3. There's more...
      4. See also
  15. Recurrent Neural Networks
    1. Introduction
    2. Implementing RNN for spam prediction
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Implementing an LSTM model
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Stacking multiple LSTM layers
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Creating sequence-to-sequence models
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    6. Training a Siamese similarity measure
      1. Getting ready
      2. How to do it...
      3. There's more...
  16. Taking TensorFlow to Production
    1. Introduction
    2. Implementing unit tests
      1. Getting ready
      2. How it works...
    3. Using multiple executors
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Parallelizing TensorFlow
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Taking TensorFlow to production
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. An example of productionalizing TensorFlow
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Using TensorFlow Serving
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  17. More with TensorFlow
    1. Introduction
    2. Visualizing graphs in TensorBoard
      1. Getting ready
      2. How to do it...
      3. There's more...
    3. Working with a genetic algorithm
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Clustering using k-means
      1. Getting ready
      2. How to do it...
      3. There's more...
    5. Solving a system of ordinary differential equations
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    6. Using a random forest
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    7. Using TensorFlow with Keras
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
  18. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think