Machine Learning Using TensorFlow Cookbook

Book description

Master TensorFlow to create powerful machine learning algorithms, with valuable insights on Keras, Boosted Trees, Tabular Data, Transformers, Reinforcement Learning and more

Key Features

  • Work with the latest code and examples for TensorFlow 2
  • Get to grips with the fundamentals including variables, matrices, and data sources
  • Learn advanced deep learning techniques to make your algorithms faster and more accurate

Book Description

The independent recipes in Machine Learning Using TensorFlow Cookbook will teach you how to perform complex data computations and gain valuable insights into your data. You will work through recipes on training models, model evaluation, sentiment analysis, regression analysis, artificial neural networks, and deep learning - each using Google's machine learning library, TensorFlow.

This cookbook begins by introducing you to the fundamentals of the TensorFlow library, including variables, matrices, and various data sources. You'll then take a deep dive into some real-world implementations of Keras and TensorFlow and learn how to use estimators to train linear models and boosted trees, both for classification and for regression to provide a baseline for tabular data problems.

As you progress, you'll explore the practical applications of a variety of deep learning architectures, such as recurrent neural networks and Transformers, and see how they can be applied to computer vision and natural language processing (NLP) problems. Once you are familiar with the TensorFlow ecosystem, the final chapter will teach you how to take a project to production.

By the end of this machine learning book, you will be proficient in using TensorFlow 2. You'll also understand deep learning from the fundamentals and be able to implement machine learning algorithms in real-world scenarios.

What you will learn

  • Grasp linear regression techniques with TensorFlow
  • Use Estimators to train linear models and boosted trees for classification or regression
  • Execute neural networks and improve predictions on tabular data
  • Master convolutional neural networks and recurrent neural networks through practical recipes
  • Apply reinforcement learning algorithms using the TF-Agents framework
  • Implement and fine-tune Transformer models for various NLP tasks
  • Take TensorFlow into production

Who this book is for

If you are a data scientist or a machine learning engineer, and you want to skip detailed theoretical explanations in favor of building production-ready machine learning models using TensorFlow, this book is for you.

Basic familiarity with Python, linear algebra, statistics, and machine learning is necessary to make the most out of this book.

Publisher resources

Download Example Code

Table of contents

  1. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Get in touch
  2. Getting Started with TensorFlow 2.x
    1. How TensorFlow works
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    2. Declaring variables and tensors
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    3. Using eager execution
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    4. Working with matrices
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    5. Declaring operations
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    6. Implementing activation functions
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    7. Working with data sources
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    8. Additional resources
      1. Getting ready
      2. How to do it…
  3. The TensorFlow Way
    1. Operations using eager execution
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Layering nested operations
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Working with multiple layers
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Implementing loss functions
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Implementing backpropagation
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Working with batch and stochastic training
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Combining everything together
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
  4. Keras
    1. Introduction
    2. Understanding Keras layers
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Using the Keras Sequential API
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    4. Using the Keras Functional API
      1. Getting ready
      2. How to do it...
        1. Creating a Functional model
        2. Using callable models like layers
        3. Creating a model with multiple inputs and outputs
        4. Shared layers
        5. Extracting and reusing nodes in the graph of layers
      3. How it works...
      4. There's more...
      5. See also
    5. Using the Keras Subclassing API
      1. Getting ready
      2. How to do it...
        1. Creating a custom layer
        2. Creating a custom model
      3. How it works...
      4. See also
    6. Using the Keras Preprocessing API
      1. Getting ready
      2. How to do it...
        1. Sequence preprocessing
        2. Text preprocessing
        3. Image preprocessing
      3. How it works...
      4. See also
  5. Linear Regression
    1. Learning the TensorFlow way of linear regression
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    2. Turning a Keras model into an Estimator
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Understanding loss functions in linear regression
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Implementing Lasso and Ridge regression
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Implementing logistic regression
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    6. Resorting to non-linear solutions
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Using Wide & Deep models
      1. Getting ready
      2. How to do it...
      3. How it works...
  6. Boosted Trees
    1. Introduction
      1. How to do it...
      2. How it works...
      3. See also
  7. Neural Networks
    1. Implementing operational gates
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Working with gates and activation functions
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Implementing a one-layer neural network
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Implementing different layers
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Using a multilayer neural network
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Improving the predictions of linear models
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Learning to play Tic-Tac-Toe
      1. Getting ready
      2. How to do it...
      3. How it works...
  8. Predicting with Tabular Data
    1. Processing numerical data
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    2. Processing dates
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    3. Processing categorical data
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    4. Processing ordinal data
      1. Getting ready
      2. How to do it…
      3. How it works…
    5. Processing high-cardinality categorical data
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    6. Wrapping up all the processing
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    7. Setting up a data generator
      1. Getting ready
      2. How to do it…
      3. How it works…
    8. Creating custom activations for tabular data
      1. Getting ready
      2. How to do it…
      3. How it works…
    9. Running a test on a difficult problem
      1. Getting ready
      2. How to do it…
      3. How it works…
  9. 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
  10. Recurrent Neural Networks
    1. Text generation
      1. How to do it...
      2. See also
    2. Sentiment classification
      1. How to do it...
      2. See also
    3. Stock price prediction
      1. How to do it...
    4. Open-domain question answering
      1. How to do it...
    5. Summary
  11. Transformers
    1. Text generation
      1. How do we go about it?
      2. Output:
      3. Output:
      4. Output:
      5. See also
    2. Sentiment analysis
      1. How do we go about it?
      2. See also
    3. Open-domain question answering
      1. How do we go about it?
  12. Reinforcement Learning with TensorFlow and TF-Agents
    1. GridWorld
      1. How do we go about it?
      2. See also
    2. CartPole
      1. How do we go about it?
      2. See also
    3. MAB
      1. How do we go about it?
      2. See also
  13. Taking TensorFlow to Production
    1. Visualizing Graphs in TensorBoard
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
      5. There's more...
    2. Managing Hyperparameter tuning with TensorBoard's HParams
      1. Getting ready
      2. How to do it...
      3. See also
    3. Implementing unit tests
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    4. Using multiple executors
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Parallelizing TensorFlow
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
      5. There's more...
    6. Saving and restoring a TensorFlow model
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    7. Using TensorFlow Serving
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  14. Other Books You May Enjoy
  15. Index

Product information

  • Title: Machine Learning Using TensorFlow Cookbook
  • Author(s): Alexia Audevart, Konrad Banachewicz, Luca Massaron
  • Release date: February 2021
  • Publisher(s): Packt Publishing
  • ISBN: 9781800208865