Deep Learning With TensorFlow

Deep Learning With TensorFlow

Shahina Anwarul (Department of Systemics, School of Computer Science, University of Petroleum and Energy Studies (UPES), India) and Deepa Joshi (Department of Systemics, School of Computer Science, University of Petroleum and Energy Studies (UPES), India)
Copyright: © 2020 |Pages: 25
DOI: 10.4018/978-1-7998-3095-5.ch004


This chapter aims to acquaint the users with key parts of TensorFlow and some basic ideas about deep learning. In particular, users will figure out how to perform fundamental calculations in TensorFlow and implementation of deep learning using TensorFlow. This chapter intends to gives a straightforward manual for the complexities of Google's TensorFlow framework that is easy to understand. The basic steps for the installation and setup of TensorFlow will also be discussed. Starting with a simple “Hello World” example, a practical implementation of deep learning problem to identify the handwritten digits will be discussed using MNIST dataset. It is only possible to understand deep learning through substantial practical examples. For that reason, the authors have included practical implementation of deep learning problems that motivates the readers to plunge deeply into these examples and to get their hands grimy trying different things with their own ideas using TensorFlow because it is never adequate to perceive algorithms only theoretically.
Chapter Preview

Deep Learning

Deep learning is a subset of machine learning in Artificial Intelligence (AI) that has networks capable of learning in a supervised, unsupervised or semi-supervised manner given in Figure 1. It is also known as deep structured learning and hierarchical learning (Jason, 2019). The core component of deep learning is a neural network. Most of the deep learning models are predicated on Artificial Neural Networks. Conventional neural networks consist of a single input layer, a single hidden layer, and one output layer. Deep learning networks are different from these conventional neural networks comprise more hidden layers as given in Figure 2. They consist of more depths, that is the reason to known as deep networks. These kinds of networks are proficient in exploring hidden structures from unlabeled and unstructured data.

Figure 1.

Relation between Artificial Intelligence, Machine Learning, and Deep Learning

Figure 2.

a) Conventional Neural Network, b) Deep Neural Network


Why Tensorflow?

Several libraries are available for the implementation of deep learning, so why TensorFlow?

These are the following features that TensorFlow offers:

  • a)

    It provides both python and C++ API’s that makes it convenient to work.

  • b)

    It supports both CPUs and GPUs computing devices.

  • c)

    It has a faster compilation time than other deep learning libraries like Keras and Torch.

In Figure 3 (Chollet, 2015), it is clearly mentioned that both industry and research community has the highest adoption of the TensorFlow library with 96.77% of the power score in 2018.

Figure 3.

Deep learning frameworks (Chollet, 2015)



Tensor is a generalization of vectors and matrices of potentially higher dimensions. It is the standard way of representing data in deep learning. In simple terms, tensor is a matrix or an array of data with different dimensions and ranks that are supplied as input to the neural network. Figures 4 and 5 represent different dimensions and ranks of tensors respectively.

Figure 4.

Different dimensions of Tensors; Tensor of dimension 1 Tensor of dimension 2 Tensor of dimension 3


Rank of tensors: It is defined as a quantity of dimensions in which the tensors live.

  • # Rank 0 is equivalent to scalar

  • # Rank 1 is equivalent to vector

  • # Rank 2 is equivalent to 2D matrix

  • # Rank 3 is equivalent to 3D matrix

Complete Chapter List

Search this Book: