TensorFlow 1.x Deep Learning Cookbook
上QQ阅读APP看书,第一时间看更新

Introduction

TensorFlow is a powerful open source software library developed by the Google Brain team for deep neural networks (DNNs). It was first made available under the Apache 2.x License in November 2015; as of today, its GitHub repository (https://github.com/tensorflow/tensorflow) has more than 17,000 commits, with roughly 845 contributors in just two years. This by itself is a measure of both the popularity and performance of TensorFlow. The following graph shows a comparison of the popular deep learning frameworks where it is clearly visible that TensorFlow is the leader among them:

The Figure is based on data taken from the Github repositories of each as on 12 July 2017. Each Bubble has a legend: (Framework, contributors).

Let's first learn what exactly TensorFlow is and why is it so popular among DNN researchers and engineers. TensorFlow, the open source deep learning library allows one to deploy deep neural networks computation on one or more CPU, GPUs in a server, desktop or mobile using the single TensorFlow API. You might ask, there are so many other deep learning libraries such as Torch, Theano, Caffe, and MxNet; what makes TensorFlow special? Most of other deep learning libraries like TensorFlow have auto-differentiation, many are open source, most support CPU/GPU options, have pretrained models, and support commonly used NN architectures like recurrent neural networks (RNNs), convolutional neural networks (CNNs), and deep belief networks (DBNs). So, what more is there in TensorFlow? Let's list them for you:

  • It works with all the cool languages. TensorFlow works with Python, C++, Java, R, and Go.
  • TensorFlow works on multiple platforms, even mobile and distributed.
  • It is supported by all cloud providers--AWS, Google, and Azure.
  • Keras, a high-level neural network API, has been integrated with TensorFlow.
  • It has better computational graph visualizations because it is native while the equivalent in Torch/Theano is not nearly as cool to look at.
  • TensorFlow allows model deployment and ease of use in production.
  • TensorFlow has very good community support.
  • TensorFlow is more than a software library; it is a suite of software that includes TensorFlow, TensorBoard, and TensorServing.

The Google research blog (https://research.googleblog.com/2016/11/celebrating-tensorflows-first-year.html) lists some of the fascinating projects done by people around the world using TensorFlow:

  • Google Translate is using TensorFlow and tensor processing units (TPUs)
  • Project Magenta, which can produce melodies using reinforcement learning-based models, employs TensorFlow
  • Australian marine biologists are using TensorFlow to find and understand sea-cows, which are on the verge of extinction
  • A Japanese farmer used TensorFlow to develop an application to sort cucumbers using physical parameters like size and shape

The list is long, and the possibilities in which one can use TensorFlow are even greater. This book aims to provide you with an understanding of TensorFlow as applied to deep learning models such that you can adapt them to your dataset with ease and develop useful applications. Each chapter contains a set of recipes which deal with the technical issues, the dependencies, the actual code, and its understanding. We have built the recipes one on another such that, by the end of each chapter, you have a fully functional deep learning model.