2. Presentation Outline
• Introduction
• History ofTensorFlow
• Features ofTensorFlow
• Working withTensorFlow
• Example : Iris Classification Problem
• Conclusion
• References
160414733094 Mohasin Ahamed
3. Introduction
• TensorFlow[1] is an open source software library for numerical computation using
data flow graphs.
• Nodes in the graph represent mathematical operations, while the graph edges
represent the multidimensional data arrays (tensors) communicated between
them.
• It is used by major companies all over the world, including Airbnb, EBay, Dropbox,
Snapchat,Twitter, Uber, SAP, Qualcomm, IBM, Intel, and of course, Google!
160414733094 Mohasin Ahamed
5. DistBeleif
• In 2011, Google Brain[2] built DistBelief as a proprietary machine learning system
based on deep learning neural networks.
• Its use grew rapidly across diverse Alphabet companies in both research and
commercial applications.
• Google assigned multiple computer scientists, including Jeff Dean, to simplify and
refactor the codebase of DistBelief into a faster, more robust application-grade
library, which becameTensorFlow.
160414733094 Mohasin Ahamed
6. TensorFlow
• TensorFlow is Google Brain's second generation system.
• Version 1.0.0 was released on February 11, 2017.
• Fact: In June 2016, Dean stated that 1,500 repositories on GitHub mentioned
TensorFlow, of which only 5 were from Google
160414733094 Mohasin Ahamed
7. Tensor Processing Unit
• In May 2016 Google announced itsTensor processing unit (TPU), an ASIC built
specifically for machine learning and tailored forTensorFlow.
• TPU is a programmable AI accelerator designed to provide high throughput of
low-precision arithmetic (e.g., 8-bit), and oriented toward using or running models
rather than training them.
• In May 2017 Google announced the second-generation, as well as the availability
of theTPUs in Google Compute Engine.
160414733094 Mohasin Ahamed
8. TensorFlow Lite
• In May 2017 Google announced a software stack specifically for Android
development,TensorFlow Lite, beginning with Android Oreo.
160414733094 Mohasin Ahamed
9. Features ofTensorFlow
• Efficiently works with mathematical expressions involving multi-dimensional
arrays
• Good support of deep neural networks and machine learning concepts.
• GPU/CPU computing where the same code can be executed on both architectures
• High scalability of computation across machines and huge data sets
• Supported by a large community of developers
160414733094 Mohasin Ahamed
10. Comparison of Different M/L Frameworks
Feature TensorFlow Theano[6] Torch[7] Caffe[8] Chainer[9] CNTK[9]
RunOn Single
Machine
Yes Yes Yes Yes Yes Yes
Run on Distributed
Machines
Yes No No No No Yes
Symbolic
differentiation
Yes Yes No No Yes No
Implemented by
C++
Yes No No Yes No No
160414733094 Mohasin Ahamed
13. Tensors
• Tensors are the basic data structures inTensorFlow, and they represent the connecting
edges in a dataflow graph.
• A tensor simply identifies a multidimensional array or list.The tensor structure can be
identified with three parameters: rank, shape, and type.
160414733094 Mohasin Ahamed
15. Dataflow Graphs
• InTensorFlow, computation is described using data flow graphs.
• Each node of the graph represents an instance of a mathematical operation (like
addition, division, or multiplication) and each edge is a multi-dimensional data set
(tensor) on which the operations are performed.
160414733094 Mohasin Ahamed
17. Deep Learning
• Deep learning (also known as deep structured learning or hierarchical learning) is
part of a broader family of machine learning methods based on learning data
representations, as opposed to task-specific algorithms. Learning can be
supervised, semi-supervised or unsupervised.
• Deep learning models are loosely related to information processing and
communication patterns in a biological nervous system, such as neural coding that
attempts to define a relationship between various stimuli and associated neuronal
responses in the brain.
160414733094 Mohasin Ahamed
20. • Estimators, which represent a complete model.The Estimator API provides
methods to train the model, to judge the model's accuracy, and to generate
predictions.
• Datasets, which build a data input pipeline.The Dataset API has methods to load
and manipulate data, and feed it into your model.The DatasetsAPI meshes well
with the Estimators API.
160414733094 Mohasin Ahamed
21. InstallingTensorFlow
• Step 1: Head over to Python 3.5.x from python.org
• Step 2: Go to the Downloads page and Select the 3.5.2 download.
• Step 3: After that you will be brought to another page, where you will need to
select either the x86-64 or amd64 installer.The one I specifically recommend for
now is theWindows x86-64 executable installer.
• Step 4: Choose Add Python 3.5 to PATH.
• Step 5: Now you should be able to see a message saying Setup was successful.
160414733094 Mohasin Ahamed
22. • Step 6: To installTensorFlow, start a terminal. Make sure that you run the cmd as
an administrator!
• Step 7: Once you’re done with that, now all you have to do is give just one simple
little command for you to finish installingTensorflow onto yourWindows. Just
enter this command:
pip3 install --upgrade tensorflow
160414733094 Mohasin Ahamed
23. EXAMPLE: IRIS CLASSIFICATION
PROBLEM [13]
• Imagine you are a botanist seeking an automated way to classify each Iris flower
you find. Machine learning provides many ways to classify flowers.
• For instance, a sophisticated machine learning program could classify flowers
based on photographs.
• Our ambitions are more modest--we're going to classify Iris flowers based solely
on the length and width of their sepals and petals.
160414733094 Mohasin Ahamed
24. • The Iris genus entails about 300 species, but our program will classify only the
following three:
a) Iris setosa
b) Iris versicolor
c) Iris virginica
Here's the representation:
• 0 represents setosa
• 1 represents versicolor
• 2 represents virginica
160414733094 Mohasin Ahamed
25. Sepal length Sepal width Petal length Petal width Species
6.4 2.8 5.6 2.2 2
5.0 2.3 3.3 1.0 1
4.9 2.5 4.5 1.7 2
5.7 3.8 1.7 0.3 0
• The last column (species) is called the label; the first four columns are
called features. Features are characteristics of an example, while the
label is the thing we're trying to predict.
160414733094 Mohasin Ahamed
26. Getting the Sample Program
• Before staring do the following:
1)InstallTensorFlow.
If you installedTensorFlow with virtualenv or Anaconda, activate your
TensorFlow environment.
2)Install or upgrade pandas by issuing the following command:
pip install pandas
160414733094 Mohasin Ahamed
27. 3)Take the following steps to get the sample program:
• Clone theTensorFlow Models repository from GitHub by entering the following command:
git clone https://github.com/tensorflow/models
• Change directory within that branch to the location containing the examples used in this document:
cd models/samples/core/get_started/
160414733094 Mohasin Ahamed
28. • You runTensorFlow programs as you would run any Python program.Therefore,
issue the following command from a command line to
run premade_estimators.py:
python premade_estimator.py
• Running the program should output a whole bunch of information ending with
three prediction lines like the following:
160414733094 Mohasin Ahamed
30. CONCLUSION
• In the end we can say thatTensorFlow is the second machine learning framework
that Google created and used to design, build, and train deep learning models.
• You can use theTensorFlow library do to numerical computations, which in itself
doesn’t seem all too special, but these computations are done with data flow
graphs.
• And it is used by major companies all over the world, including Airbnb, EBay,
Dropbox, Snapchat,Twitter, Uber, SAP, Qualcomm, IBM, Intel, and of course,
Google!
160414733094 Mohasin Ahamed