Mastering TensorFlow 1.x
eBook - ePub

Mastering TensorFlow 1.x

Armando Fandango, Nick McClure

  1. 474 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering TensorFlow 1.x

Armando Fandango, Nick McClure

Book details
Book preview
Table of contents
Citations

About This Book

Build, scale, and deploy deep neural network models using the star libraries in Python

Key Features

  • Delve into advanced machine learning and deep learning use cases using Tensorflow and Keras
  • Build, deploy, and scale end-to-end deep neural network models in a production environment
  • Learn to deploy TensorFlow on mobile, and distributed TensorFlow on GPU, Clusters, and Kubernetes

Book Description

TensorFlow is the most popular numerical computation library built from the ground up for distributed, cloud, and mobile environments. TensorFlow represents the data as tensors and the computation as graphs.

This book is a comprehensive guide that lets you explore the advanced features of TensorFlow 1.x. Gain insight into TensorFlow Core, Keras, TF Estimators, TFLearn, TF Slim, Pretty Tensor, and Sonnet. Leverage the power of TensorFlow and Keras to build deep learning models, using concepts such as transfer learning, generative adversarial networks, and deep reinforcement learning. Throughout the book, you will obtain hands-on experience with varied datasets, such as MNIST, CIFAR-10, PTB, text8, and COCO-Images.

You will learn the advanced features of TensorFlow1.x, such as distributed TensorFlow with TF Clusters, deploy production models with TensorFlow Serving, and build and deploy TensorFlow models for mobile and embedded devices on Android and iOS platforms. You will see how to call TensorFlow and Keras API within the R statistical software, and learn the required techniques for debugging when the TensorFlow API-based code does not work as expected.

The book helps you obtain in-depth knowledge of TensorFlow, making you the go-to person for solving artificial intelligence problems. By the end of this guide, you will have mastered the offerings of TensorFlow and Keras, and gained the skills you need to build smarter, faster, and efficient machine learning and deep learning systems.

What you will learn

  • Master advanced concepts of deep learning such as transfer learning, reinforcement learning, generative models and more, using TensorFlow and Keras
  • Perform supervised (classification and regression) and unsupervised (clustering) learning to solve machine learning tasks
  • Build end-to-end deep learning (CNN, RNN, and Autoencoders) models with TensorFlow
  • Scale and deploy production models with distributed and high-performance computing on GPU and clusters
  • Build TensorFlow models to work with multilayer perceptrons using Keras, TFLearn, and R
  • Learn the functionalities of smart apps by building and deploying TensorFlow models on iOS and Android devices
  • Supercharge TensorFlow with distributed training and deployment on Kubernetes and TensorFlow Clusters

Who this book is for

This book is for data scientists, machine learning engineers, artificial intelligence engineers, and for all TensorFlow users who wish to upgrade their TensorFlow knowledge and work on various machine learning and deep learning problems. If you are looking for an easy-to-follow guide that underlines the intricacies and complex use cases of machine learning, you will find this book extremely useful. Some basic understanding of TensorFlow is required to get the most out of the book.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Mastering TensorFlow 1.x an online PDF/ePUB?
Yes, you can access Mastering TensorFlow 1.x by Armando Fandango, Nick McClure in PDF and/or ePUB format, as well as other popular books in Informatik & Data Mining. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781788297004
Edition
1
Subtopic
Data Mining

Transfer Learning and Pre-Trained Models

In simple words, transfer learning means that you take a pre-trained model trained to predict one kind of class, and then either use it directly or re-train only a small part of it, in order to predict another kind of class. For example, you can take a pre-trained model to identify types of cats, and then retrain only small parts of the model on the types of dogs and then use it to predict the types of dogs.
Without transfer learning, training a huge model on large datasets would take several days or even months. However, with transfer learning, by taking a pre-trained model, and only training the last couple of layers, we save a lot of time in training the model from scratch.
Transfer learning is also useful when you don't have a huge dataset. The models trained on small datasets may not be able to detect features that a model trained on large datasets can. Thus with transfer learning, you can get better models, even with smaller datasets.
In this chapter, we shall take pre-trained models and train them on new objects. We show examples of pre-trained models with images and apply them to image classification problems. You should try to find other pre-trained models and apply them to different problems such as object detection, text generation or machine translation. The following topics will be covered in this chapter:
  • ImageNet dataset
  • Retraining or fine-tuning the models
  • COCO animals dataset and preprocessing
  • Image classification using pre-trained VGG16 in TensorFlow
  • Image preprocessing in TensorFlow for pre-trained VGG16
  • Image classification using retrained VGG16 in TensorFlow
  • Image classification using pre-trained VGG16 in Keras
  • Image classification using retrained VGG16 in Keras
  • Image classification using Inception v3 in TensorFlow
  • Image classification using retrained Inception v3 in TensorFlow

ImageNet dataset

According to http://image-net.org:
ImageNet is an image dataset organized according to the WordNet hierarchy. Each meaningful concept in WordNet, possibly described by multiple words or word phrases, is called a synonym set or synset.
The ImageNet has about 100 K synsets and on average, about 1,000 human-annotated images for each synset. ImageNet only stores the references to the images while the images are stored in their original locations on the internet. In deep learning papers, the ImageNet-1K refers to the dataset released as part of ImageNet's Large Scale Visual Recognition Challenge (ILSVRC) to classify the dataset into 1,000 categories:
The 1,000 categories for the challenges can be found at the following URLs:
http://image-net.org/challenges/LSVRC/2017/browse-synsets
http://image-net.org/challenges/LSVRC/2016/browse-synsets
http://image-net.org/challenges/LSVRC/2015/browse-synsets
http://image-net.org/challenges/LSVRC/2014/browse-synsets
http://image-net.org/challenges/LSVRC/2013/browse-synsets
http://image-net.org/challenges/LSVRC/2012/browse-synsets
http://image-net.org/challenges/LSVRC/2011/browse-synsets
http://image-net.org/challenges/LSVRC/2010/browse-synsets.
We have written a custom function to download the ImageNet labels from Google:
def build_id2label(self):
base_url = 'https://raw.githubusercontent.com/tensorflow/models/master/research/inception/inception/data/'
synset_url = '{}/imagenet_lsvrc_2015_synsets.txt'.format(base_url)
synset_to_human_url = '{}/imagenet_metadata.txt'.format(base_url)

filename, _ = urllib.request.urlretrieve(synset_url)
synset_list = [s.strip() for s in open(filename).readlines()]
nu...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. Packt Upsell
  4. Foreword
  5. Contributors
  6. Preface
  7. TensorFlow 101
  8. High-Level Libraries for TensorFlow
  9. Keras 101
  10. Classical Machine Learning with TensorFlow
  11. Neural Networks and MLP with TensorFlow and Keras
  12. RNN with TensorFlow and Keras
  13. RNN for Time Series Data with TensorFlow and Keras
  14. RNN for Text Data with TensorFlow and Keras
  15. CNN with TensorFlow and Keras
  16. Autoencoder with TensorFlow and Keras
  17. TensorFlow Models in Production with TF Serving
  18. Transfer Learning and Pre-Trained Models
  19. Deep Reinforcement Learning
  20. Generative Adversarial Networks
  21. Distributed Models with TensorFlow Clusters
  22. TensorFlow Models on Mobile and Embedded Platforms
  23. TensorFlow and Keras in R
  24. Debugging TensorFlow Models
  25. Tensor Processing Units
  26. Other Books You May Enjoy
Citation styles for Mastering TensorFlow 1.x

APA 6 Citation

Fandango, A. (2018). Mastering TensorFlow 1.x (1st ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/578781/mastering-tensorflow-1x-pdf (Original work published 2018)

Chicago Citation

Fandango, Armando. (2018) 2018. Mastering TensorFlow 1.x. 1st ed. Packt Publishing. https://www.perlego.com/book/578781/mastering-tensorflow-1x-pdf.

Harvard Citation

Fandango, A. (2018) Mastering TensorFlow 1.x. 1st edn. Packt Publishing. Available at: https://www.perlego.com/book/578781/mastering-tensorflow-1x-pdf (Accessed: 14 October 2022).

MLA 7 Citation

Fandango, Armando. Mastering TensorFlow 1.x. 1st ed. Packt Publishing, 2018. Web. 14 Oct. 2022.