Book Image

TensorFlow 1.x Deep Learning Cookbook

Book Image

TensorFlow 1.x Deep Learning Cookbook

Overview of this book

Deep neural networks (DNNs) have achieved a lot of success in the field of computer vision, speech recognition, and natural language processing. This exciting recipe-based guide will take you from the realm of DNN theory to implementing them practically to solve real-life problems in the artificial intelligence domain. In this book, you will learn how to efficiently use TensorFlow, Google’s open source framework for deep learning. You will implement different deep learning networks, such as Convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), Deep Q-learning Networks (DQNs), and Generative Adversarial Networks (GANs), with easy-to-follow standalone recipes. You will learn how to use TensorFlow with Keras as the backend. You will learn how different DNNs perform on some popularly used datasets, such as MNIST, CIFAR-10, and Youtube8m. You will not only learn about the different mobile and embedded platforms supported by TensorFlow, but also how to set up cloud platforms for deep learning applications. You will also get a sneak peek at TPU architecture and how it will affect the future of DNNs. By using crisp, no-nonsense recipes, you will become an expert in implementing deep learning techniques in growing real-world applications and research areas such as reinforcement learning, GANs, and autoencoders.
Table of Contents (15 chapters)
14
TensorFlow Processing Units

What this book covers

Chapter 1, TensorFlow - An Introduction, discusses TensorFlow the Google's open source framework, and why it is useful for deep learning. We will discuss how to install TensorFlow on MAC, Windows and Ubuntu for both CPU and GPU. We will also discuss other python packages that we will use throughout the book. We will explain the two components of TensorFlow codes, the definition of graph and its execution. We will learn about using the TensorBoard to see the graph structure. We will understand the difference between TensorFlow constants, variables and placeholders. And we will also get a taste of TensorFlow estimators.

Chapter 2 , Regression, talks about regression and its applications. We will discuss the concepts involved in regression, understand how it is different from clustering and classification. We will learn about different types of loss functions possible and how to implement them in Tensorflow. We learn how to implement L1 and L2 regularizations. We will discuss the gradient descent algorithm, learn how to optimize it and implement it in Tensorflow. We will briefly learn about cross-entropy function and its implementation.

Chapter 3 , Neural Networks - Perceptron, covers artificial neural networks and explains why it can do the wonderful tasks as claimed recently by DNN. We will learn about different choices of activation functions. We will use all this to build a simple perceptron and use it for function modeling. We will learn about regularization of data before training. We will also learn to build a multilayer perceptron (MLP) layer by layer. We will see how the auto-differentiator of TensorFlow makes our work easier.

Chapter 4 , TensorFlow - Convolutional Neural Networks, discusses the process of convolution and how it is able to extract features. We will learn about three important layers of CNN: convolutional layers, pooling layer and fully connected layer. We will also learn about dropout, how it can increase performance and different CNN architectures such as LeNET and GoogleNET.

Chapter 5, CNN in Action, covers some wow success stories of CNN like face recognition. We will write a recipe for using CNNs for sentiment analysis. We will discuss pre-tuning CNN and learn how to implement transfer learning. We will learn how to use VGG16 for transfer learning. We will learn classification of images with VGGNet, ResNet, Inception and Xception. We will Generate music using dilated ConvNets, Wavenet and Nsynth. We will also learn how to do Visual Q & A. We will learn how to classify videos.

Chapter 6, Recurrent Neural Networks, discusses Recurrent Neural networks. We will learn the basic unit of RNNs the RNN cell. We will learn about word embeddings and time sequencing. We will briefly discuss LSTM networks. We will learn about seq2seq RNNs. We will learn how RNNs can be employed for machine translation, generating text, and predicting future values

Chapter 7, Unsupervised Learning, teaches the unsupervised learning paradigm. We will learn about clustering and dimensionality reduction. We will learn about techniques like Principal Component Analysis (PCA) and see how they can be used for dimensionality reduction. We will learn about k-means clustering. We will understand the concept of Topographic maps and learn how to train self-organizing maps. We will learn about Restricted Boltzmann Machines (RBM). We will discuss the architecture and training of RBMs. We learn how to stack RBMs to make Deep Belief Networks, and we will learn how to train them. We will train DBN using the concept of pre-training and fine tuning for emotion detection.

Chapter 8, Autoencoders, demystifies autoencoders. We will learn about autoencoders and their applications. We will discuss various real-life examples where auto-encoders can be used. We will discuss the process of encoding and subsequent reconstruction. We will learn about reconstruction error. We will learn about sparse autoencoders, the concept of KL divergence. We will learn Denoising Autoencoders and use them to reconstruct clean images given noisy images. We will learn how to build Convolutional Autoencoders and Stacked Autoencoders.

Chapter 9, Reinforcement Learning, covers different reinforcement learning algorithms. We will learn the Q-learning algorithm. We will discuss Bellman-Ford equation and how to choose learning rate, discount factor. We will learn how to use OpenAI gym framework. We will learn about the concepts of Experience Replay and buffering to implement value-iteration Q network. We will use Q learning and policy gradients to build game playing agents. And finally, we will learn how to make our own Deep Q-learning Network (DQN). A brief description of AlphaGo Zero and its grand win.

Chapter 10, TensorFlow Mobile Computation, covers TensorFlow mobile. We will learn about different applications of mobile deep learning. We will learn how to use Tensorflow with Android studio on Windows platform. We will learn how to use Tensorflow along with XCode to make IOS based apps. We will learn how to optimize the Tensorflow graphs for mobile devices. We will also learn how to transform Tensorflow graphs for mobile devices.

Chapter 11, TensorFlow – Generative Adversarial Networks (GANs), Variational Autoencoders, and Capsule networks, starts with generative adversarial networks and their strength over other DNNs. We explore different predictive models. We understand the motivation behind GANs and their working intuitively. We learn about the basic GAN architecture. We will explore some very cool applications of GANs. We will learn about another generative network the Variational Autoencoder. Lastly, we will learn about the recently proposed Capsule Networks

Chapter 12, Distributed TensorFlow and Cloud Deep Learning, explains the cloud environment, dockers, containers, and how to use them. We learn how to work with distributed Tensorflow with multiple GPUs, and multiple servers. We learn how to setup AWS for deep learning. We learn how to setup Google cloud for deep learning applications. We learn how to setup Microsoft Azure cloud for deep learning applications. We learn about other available cloud services

Appendix A, Learning to Learn with AutoML (Meta-Learning), briefly talks about AutoML and Siamese Networks.

Appendix B, TensorFlow Processing Unit, covers Tensor Processing Unit, its basic architecture, and how it will affect DNN's future.