AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Agenda
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Agenda
Introduction 01
What is TensorFlow?
Learning 02
Getting Started 03
Basic Code 04
What’s the easiest way to
learn TensorFlow?
Understanding
TensorFlow code!
What’s the fastest way to get
TensorFlow?
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
What Is TensorFlow?
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
What Is TensorFlow?
Open Source
TensorFlow is an open source library for numerical computation
and large-scale machine learning.
Definition
Available on both
Desktop and Mobile
Largest community
for Learners and
CollaboratorsLet’s get started then!
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Why Is TensorFlow So Popular?
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Popularity Of TensorFlow
As simple as pointing your phone!
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Popularity Of TensorFlow
Scam ProtectionFree Documents too!
Millions of happy travelers!
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Easiest Way To Get Started!
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Get Started!
Google
Colaboratory!
PyCharm
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Why Should You Learn TensorFlow?
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Why Should You Learn TensorFlow?
Learner’s Timeline
Train an Image Classifier Work on accuracy
Concept-heavy but code-light
Work on the purpose!
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Some Math!
The Math can be overwhelming at start!
Programming
Rules
Data
Answers
Machine Learning
Answers
Data
Rules
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Linear Regression – An Example
Let’s have an example!
A simple Linear Regression can
be:
y= w * x + b
Technique
Statistical technique used to
measure the relationship
between the variables
y = 0.1 * x + 0.3 Our Solution!
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
First Neural Network
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
First Neural Network
Steps to train your first Neural Network
Most of the work!
Few lines of code!
Just one line!
Just one line!
Just one line!Collect a dataset Train the Network
Predict
Build your model Evaluate
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
TensorFlow Architecture
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
TensorFlow Architecture
What is a Data Flow Graph? Recall the equation y = W * x + b
W - Weight x - Example b - Bias
Biases
Weight
Examples
MatMul
Add ReLu Gradients
Updated
Weights and
Biases
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
TensorFlow Architecture
TensorFlow runtime is a cross-platform library
Separates user level code in different languages from core runtime
Construction Phase Execution Phase
CLIENT WORKERS
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
TensorFlow Architecture
Worker’s Device Interactions
Client Master Worker
GPU #1 GPU #2 CPU #0
Session
Master Create Sessions
Execute Operations in the GraphWorker
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
TensorFlow Pipeline
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Simple Code - Pipeline
Steps to create a TensorFlow Pipeline
Create Data
Create Placeholder
Define Dataset
Create Pipeline
Execute Operation
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Simple Code - Pipeline
Create Data
Create Placeholder
Define Dataset
Create Pipeline
Execute Operation
import numpy as np
x_input = np.random.sample((1,2))
print(x_input)
[[0.8835775 0.23766977]]
MNIST
CIFAR 10
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Simple Code - Pipeline
Create Data
Create Placeholder
Define Dataset
Create Pipeline
Execute Operation
# using a placeholder
x = tf.placeholder(tf.float32, shape=[1,2], name = 'X')
=
It allows us to create our operations and build
our computation graph, without needing the data.
Does it differ, by a little?
YES!
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Simple Code - Pipeline
Create Data
Create Placeholder
Define Dataset
Create Pipeline
Execute Operation
dataset = tf.data.Dataset.from_tensor_slices(x)
Represents a sequence of elements
Tensor 1
Element Tensor 2
Tensor 3
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Simple Code - Pipeline
Create Data
Create Placeholder
Define Dataset
Create Pipeline
Execute Operation
iterator = dataset.make_initializable_iterator()
get_next = iteraror.get_next()
Where should the data flow?
Initialize
Feed the Data
Next Data
Loop
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Simple Code - Pipeline
Create Data
Create Placeholder
Define Dataset
Create Pipeline
Execute Operation
with tf.Session() as sess:
# feed the placeholder with data
sess.run(iterator.initializer, feed_dict={ x: x_input })
print(sess.run(get_next))
[0.8835775 0.23766978]
Initiate a session
Run operation iterator
Feed Numpy values
Populate Placeholder
Print the result
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Conclusion
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Conclusion #1
3 Major Highlights!
tf.keras is basically like Lego building blocks!
Eager Execution Makes TF code as easy as Python
Tf.data LOT OF INFORMATION!
Layers Hyperparameters
Optimizers
AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Conclusion #2
Introduction To TensorFlow | Deep Learning with TensorFlow | TensorFlow For Beginners | Edureka

Introduction To TensorFlow | Deep Learning with TensorFlow | TensorFlow For Beginners | Edureka

  • 1.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Agenda
  • 2.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Agenda Introduction 01 What is TensorFlow? Learning 02 Getting Started 03 Basic Code 04 What’s the easiest way to learn TensorFlow? Understanding TensorFlow code! What’s the fastest way to get TensorFlow?
  • 3.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow What Is TensorFlow?
  • 4.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow What Is TensorFlow? Open Source TensorFlow is an open source library for numerical computation and large-scale machine learning. Definition Available on both Desktop and Mobile Largest community for Learners and CollaboratorsLet’s get started then!
  • 5.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Why Is TensorFlow So Popular?
  • 6.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Popularity Of TensorFlow As simple as pointing your phone!
  • 7.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Popularity Of TensorFlow Scam ProtectionFree Documents too! Millions of happy travelers!
  • 8.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Easiest Way To Get Started!
  • 9.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Get Started! Google Colaboratory! PyCharm
  • 10.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Why Should You Learn TensorFlow?
  • 11.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Why Should You Learn TensorFlow? Learner’s Timeline Train an Image Classifier Work on accuracy Concept-heavy but code-light Work on the purpose!
  • 12.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Some Math! The Math can be overwhelming at start! Programming Rules Data Answers Machine Learning Answers Data Rules
  • 13.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Linear Regression – An Example Let’s have an example! A simple Linear Regression can be: y= w * x + b Technique Statistical technique used to measure the relationship between the variables y = 0.1 * x + 0.3 Our Solution!
  • 14.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow First Neural Network
  • 15.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow First Neural Network Steps to train your first Neural Network Most of the work! Few lines of code! Just one line! Just one line! Just one line!Collect a dataset Train the Network Predict Build your model Evaluate
  • 16.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow TensorFlow Architecture
  • 17.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow TensorFlow Architecture What is a Data Flow Graph? Recall the equation y = W * x + b W - Weight x - Example b - Bias Biases Weight Examples MatMul Add ReLu Gradients Updated Weights and Biases
  • 18.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow TensorFlow Architecture TensorFlow runtime is a cross-platform library Separates user level code in different languages from core runtime Construction Phase Execution Phase CLIENT WORKERS
  • 19.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow TensorFlow Architecture Worker’s Device Interactions Client Master Worker GPU #1 GPU #2 CPU #0 Session Master Create Sessions Execute Operations in the GraphWorker
  • 20.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow TensorFlow Pipeline
  • 21.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Simple Code - Pipeline Steps to create a TensorFlow Pipeline Create Data Create Placeholder Define Dataset Create Pipeline Execute Operation
  • 22.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Simple Code - Pipeline Create Data Create Placeholder Define Dataset Create Pipeline Execute Operation import numpy as np x_input = np.random.sample((1,2)) print(x_input) [[0.8835775 0.23766977]] MNIST CIFAR 10
  • 23.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Simple Code - Pipeline Create Data Create Placeholder Define Dataset Create Pipeline Execute Operation # using a placeholder x = tf.placeholder(tf.float32, shape=[1,2], name = 'X') = It allows us to create our operations and build our computation graph, without needing the data. Does it differ, by a little? YES!
  • 24.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Simple Code - Pipeline Create Data Create Placeholder Define Dataset Create Pipeline Execute Operation dataset = tf.data.Dataset.from_tensor_slices(x) Represents a sequence of elements Tensor 1 Element Tensor 2 Tensor 3
  • 25.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Simple Code - Pipeline Create Data Create Placeholder Define Dataset Create Pipeline Execute Operation iterator = dataset.make_initializable_iterator() get_next = iteraror.get_next() Where should the data flow? Initialize Feed the Data Next Data Loop
  • 26.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Simple Code - Pipeline Create Data Create Placeholder Define Dataset Create Pipeline Execute Operation with tf.Session() as sess: # feed the placeholder with data sess.run(iterator.initializer, feed_dict={ x: x_input }) print(sess.run(get_next)) [0.8835775 0.23766978] Initiate a session Run operation iterator Feed Numpy values Populate Placeholder Print the result
  • 27.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Conclusion
  • 28.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Conclusion #1 3 Major Highlights! tf.keras is basically like Lego building blocks! Eager Execution Makes TF code as easy as Python Tf.data LOT OF INFORMATION! Layers Hyperparameters Optimizers
  • 29.
    AI & DeepLearning Training www.edureka.co/ai-deep-learning-with-tensorflow Conclusion #2