SlideShare a Scribd company logo
1 of 61
Download to read offline
Presentation by:
In the name of God
Professor :
1
Introduction To Using TensorFlow
2Introduction To Using TensorFlow
Overview
■ TensorFlow
– What is TensorFlow
– TensorFlow Code Basics
– TensorFlow UseCase
■ Deep Learning
– CNN & RNN
– Exmple of Mnist Data Set Classification
What is TensorFlow
3Introduction To Using TensorFlow
What are Tensors?
As shown in the image above, tensors are just multidimensional arrays, that allows you to represent data
having higher dimensions.
9 …
0
What is TensorFlow
■ VGG Network
■ Plain Network
■ Residual Network
■ Experiments
■ Conclusion Network
4Introduction To Using TensorFlow
What are Tensors & Flow?
In fact, the name “TensorFlow” has been derived from the operations which neural networks
perform on tensors.
TensorFlow is a library based on Python that provides different types of functionality for implementing
Deep Learning Models. the term TensorFlow is made up of two terms – Tensor & Flow:
What is TensorFlow
5Introduction To Using TensorFlow
TensorFlow (data flow) graph
TensorFlow Code Basics
6Introduction To Using TensorFlow
■ Basically, the overall process of writing a TensorFlow program
involves two steps:
■ Building a Computational Graph
■ Running a Computational Graph
Let me explain you the above two steps one by one:
TensorFlow Code Basics
7Introduction To Using TensorFlow
■ Building & Running The Computational Graph
■ Example: Tensor & Flow OR Data & Flow
import tensorflow as tf
# Build a graph
a = tf.constant(8.0)
b = tf.constant(9.0)
c = a * b
# Create the session object
sess = tf.Session()
output_c = sess.run(c)
print(output_c)
sess.close()
What is TensorFlow
8Introduction To Using TensorFlow
 Main Components of Tensorflow:
A. Variables: Retain values between sessions, use for
weights/bias
B. Nodes: The operations
C. Tensors: Signals that pass from/to nodes
D. Placeholders: Used to send data between your
program and the tensorflow graph
E. Session: Place when graph is executed.
Points to Remember about placeholders:
•Placeholders are not initialized and contains no data.
•One must provides inputs or feeds to the placeholder which are considered during runtime.
•Executing a placeholder without input generates an error.
TensorFlow Code Basics
9Introduction To Using TensorFlow
■ Building & Running The Computational Graph
■ Constants, Placeholder and Variables
import tensorflow as tf
# Creating placeholders
a = tf. placeholder(tf.float32)
b = tf. placeholder(tf.float32)
# Assigning multiplication operation w.r.t. a & b to node mul
mul = a*b
# Create session object
sess = tf.Session()
# Executing mul by passing the values [1, 3] [2, 4] for a and b respectively
output = sess.run(mul, {a: [1,3], b: [2, 4]})
print('Multiplying a b:', output)
Output: [2. 12.]
TensorFlow Code Basics
10Introduction To Using TensorFlow
■ Example : Linear Regression on tensorflow
TensorFlow Code Basics
11Introduction To Using TensorFlow
■ Example : Linear Regression on tensorflow
TensorFlow Code Basics
12Introduction To Using TensorFlow
■ Example : Linear Regression on tensorflow
TensorFlow Code Basics
13Introduction To Using TensorFlow
■ Example : Linear Regression on tensorflow
TensorFlow Code Basics
14Introduction To Using TensorFlow
■ Example : Linear Regression on tensorflow
15Introduction To Using TensorFlow
Deep Learning
CNN & RNN
Artificial Intelligence
16Introduction To Using TensorFlow
Deep Learning & Machine Learning
Deep Learning
17Introduction To Using TensorFlow
■ Deep Learning vs Machine Learning
Deep Learning
18Introduction To Using TensorFlow
■ Deep Learning with Neural Network
Deep Learning
19Introduction To Using TensorFlow
■ Deep Learning with Neural Network
Deep Learning
20Introduction To Using TensorFlow
■ Deep Learning with Neural Network
TensorFlow Code Basics
21Introduction To Using TensorFlow
■ Example of Neural Network:
Deep Learning
22Introduction To Using TensorFlow
■ Neural Network (NN)
Forward Pass Backward Pass
Deep Learning
23Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
The three main processing stages in a CNN
Deep Learning
24Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
Deep Learning
25Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
Example filters learned by Krizhevsky et al. Each of the 96 filters shown here is of size [11x11x3], and each
one is shared by the 55*55 neurons in one depth slice.
1 2 3
Deep Learning
26Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
Deep Learning
27Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
Deep Learning
28Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
Deep Learning
29Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
Deep Learning
30Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN) Denoising
Deep Learning
31Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
Deep Learning
32Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
Deep Learning
33Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
Deep Learning
34Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
Deep Learning
35Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
Deep Learning
36Introduction To Using TensorFlow
■ Convolutional Neural Network (CNN)
http://scs.ryerson.ca/~aharley/vis/conv/The three main processing stages in a CNN
Deep Learning
37Introduction To Using TensorFlow
■ Example :
Deep Learning
38Introduction To Using TensorFlow
■ Example :
Deep Learning
39Introduction To Using TensorFlow
■ Example :
TensorFlow Code Basics
40Introduction To Using TensorFlow
■ Example :
Multi Layer Perceptron MNIST on tensorflow
The MNIST database (Modified National Institute of Standards and Technology database) is a large database of
handwritten digits that is commonly used for training various image processing systems.
TensorFlow Code Basics
41Introduction To Using TensorFlow
■ Example : Multi Layer Perceptron MNIST on tensorflow
1. Load tensorflow library and MNIST data
2. Neural network parameters
3. Build graph
4. Initialize weights and construct the model
5. Define Loss function, and Optimizer
6. Launch graph
TensorFlow Code Basics
42Introduction To Using TensorFlow
# Parameters
learning_rate = 0.001 training_epochs = 15 batch_size = 100
# Network Parameters
n_hidden_1 = 256 n_hidden_2 = 256 n_input = 784 n_classes = 10
# On this case we choose the AdamOptimizer
optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)
# Cross entropy loss function
cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(pred, y))
■ Example :
TensorFlow Code Basics
43Introduction To Using TensorFlow
■ Example : Multi Layer Perceptron MNIST on tensorflow
1. Load tensorflow library and MNIST data
import tensorflow as tf # Import MNIST data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
print('Test shape:',mnist.test.images.shape)
print('Train shape:',mnist.train.images.shape)
Test shape: (10000, 784)
Train shape: (55000, 784)
TensorFlow Code Basics
44Introduction To Using TensorFlow
■ Example : Multi Layer Perceptron MNIST on tensorflow
# Parameters
learning_rate = 0.001
training_epochs = 15
batch_size = 100
display_step = 1
# Network Parameters
n_hidden_1 = 256 # 1st layer number of features
n_hidden_2 = 256 # 2nd layer number of features
n_input = 784 # MNIST data input (img shape: 28*28)
n_classes = 10 # MNIST total classes (0-9 digits)
2. Neural network parameters
TensorFlow Code Basics
45Introduction To Using TensorFlow
■ Example : Multi Layer Perceptron MNIST on tensorflow
x = tf.placeholder("float", [None, n_input])
y = tf.placeholder("float", [None, n_classes])
# Create model
def multilayer_perceptron(x, weights, biases):
print('x:',x.get_shape(),'W1:',weights['h1'].get_shape(),'b1:',biases['b1'].get_shape())
layer_1 = tf.add(tf.matmul(x, weights['h1']), biases['b1'])
layer_1 = tf.nn.relu(layer_1)
print( 'layer_1:', layer_1.get_shape(), 'W2:', weights['h2'].get_shape(), 'b2:',
biases['b2'].get_shape())
layer_2 = tf.add(tf.matmul(layer_1, weights['h2']), biases['b2'])
layer_2 = tf.nn.relu(layer_2)
print( 'layer_2:', layer_2.get_shape(), 'W3:', weights['out'].get_shape(), 'b3:',
biases['out'].get_shape())
out_layer = tf.matmul(layer_2, weights['out']) + biases['out']
print('out_layer:',out_layer.get_shape()) return out_layer
3. Build graph
TensorFlow Code Basics
46Introduction To Using TensorFlow
■ Example : Multi Layer Perceptron MNIST on tensorflow
# Store layers weight & bias
weights = { 'h1': tf.Variable(tf.random_normal([n_input, n_hidden_1])), #784x256
'h2': tf.Variable(tf.random_normal([n_hidden_1, n_hidden_2])), #256x256
'out': tf.Variable(tf.random_normal([n_hidden_2, n_classes])) #256x10
}
biases = { 'b1': tf.Variable(tf.random_normal([n_hidden_1])), #256x1
'b2': tf.Variable(tf.random_normal([n_hidden_2])), #256x1
'out': tf.Variable(tf.random_normal([n_classes])) #10x1
}
# Construct model
pred = multilayer_perceptron(x, weights, biases)
4. Initialize weights and construct the model
TensorFlow Code Basics
47Introduction To Using TensorFlow
■ Example : Multi Layer Perceptron MNIST on tensorflow
5. Define Loss function, and Optimizer
# Cross entropy loss function
cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(pred, y))
# On this case we choose the AdamOptimizer
optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)
TensorFlow Code Basics
48Introduction To Using TensorFlow
■ Example : Multi Layer Perceptron MNIST on tensorflow
6.1 Launch graph
# Initializing the variables
init = tf.initialize_all_variables()
# Launch the graph
with tf.Session() as sess:
sess.run(init)
# Training cycle
for epoch in range(training_epochs):
avg_cost = 0.
total_batch = int(mnist.train.num_examples/batch_size)
# Loop over all batches
for i in range(total_batch):
batch_x, batch_y = mnist.train.next_batch(batch_size)
# Run optimization op (backprop) and cost op (to get loss value)
_, c = sess.run([optimizer, cost], feed_dict={x: batch_x, y: batch_y})
# Compute average loss
avg_cost += c / total_batch
TensorFlow Code Basics
49Introduction To Using TensorFlow
■ Example : Multi Layer Perceptron MNIST on tensorflow
6.2 Launch graph
# Display logs per epoch step
if epoch % display_step == 0:
print ("Epoch:", '%04d' % (epoch+1), "cost=", 
"{:.9f}".format(avg_cost))
print("Optimization Finished!")
# Test model
correct_prediction = tf.equal(tf.argmax(pred, 1), tf.argmax(y, 1))
# Calculate accuracy
accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float"))
# To keep sizes compatible with model
print ("Accuracy:", accuracy.eval({x: mnist.test.images, y: mnist.test.labels}))
TensorFlow Code Basics
50Introduction To Using TensorFlow
■ Example : Multi Layer Perceptron MNIST on tensorflow
6.2 Output of Execute graph with CNN
Epoch: 0001 cost= 152.289635962
Epoch: 0002 cost= 39.134648348
...
Epoch: 0015 cost= 0.850344581
Optimization Finished!
Accuracy: 0.9464
Deep Learning Layer
51Introduction To Using TensorFlow
W
Increasing Depth Layer ?Increasing Parameter ?
Become Overfit
GoogleNet
52Introduction To Using TensorFlow
ResNet
53Introduction To Using TensorFlow
54Introduction To Using TensorFlow
Results :
CapsNet
55Introduction To Using TensorFlow
Parallel Processing
56Introduction To Using TensorFlow
Parallel Processing
57Introduction To Using TensorFlow
Reference
58Introduction To Using TensorFlow
https://www.edureka.co/blog/tensorflow-tutorial/
http://howsam.org/1396/08/11/%D8%A2%D9%85%D9%88%D8%B2%D8%B4-
%D8%AA%D9%86%D8%B3%D9%88%D8%B1%D9%81%D9%84%D9%88/
http://www.7khatcode.com/7677/%D8%AA%D9%86%D8%B3%D9%88%D8%B1%D9%81%D9
%84%D9%88-tensorflow-%DA%86%DB%8C%D8%B3%D8%AA%D8%9F
https://blog.faradars.org/cnn-convolution-perceptron-neural-network-2/
https://leonardoaraujosantos.gitbooks.io/artificial-inteligence/content/loss-function.html
https://medium.com/machine-learning-in-practice/over-150-of-the-best-machine-learning-nlp-and-
python-tutorials-ive-found-ffce2939bd78
https://ujjwalkarn.me/2016/08/11/intuitive-explanation-convnets/
http://howsam.org/1396/08/12/%D9%86%D8%B5%D8%A8-
%D8%AA%D9%86%D8%B3%D9%88%D8%B1%D9%81%D9%84%D9%88/
Reference
59Introduction To Using TensorFlow
http://howsam.org/1396/08/16/%D8%B4%D8%B1%D9%88%D8%B9-%DA%A9%D8%A7%D8%B1-
%D8%A8%D8%A7-%D8%AA%D9%86%D8%B3%D9%88%D8%B1%D9%81%D9%84%D9%88/
https://stanford.edu/~shervine/l/fa/teaching/cs-229/cheatsheet-supervised-learning
https://stanford.edu/~shervine/l/fa/teaching/cs-229/cheatsheet-deep-learning
https://stanford.edu/~shervine/l/fa/teaching/cs-229/cheatsheet-machine-learning-tips-and-tricks
https://chistio.ir/%D9%BE%D8%B3-%D8%A7%D9%86%D8%AA%D8%B4%D8%A7%D8%B1-
%D8%AE%D8%B7%D8%A7-back-propagation-%D8%B4%D8%A8%DA%A9%D9%87-
%D8%B9%D8%B5%D8%A8%DB%8C/
http://deeplearning.ir/%D9%BE%DB%8C%D8%B4%DB%8C%D9%86%D9%87-%D9%88-
%D9%85%D8%B1%D9%88%D8%B1%DB%8C-%D8%A8%D8%B1-
%D8%B1%D9%88%D8%B4%D9%87%D8%A7%DB%8C-
%D9%85%D8%AE%D8%AA%D9%84%D9%81-
%DB%8C%D8%A7%D8%AF%DA%AF%DB%8C%D8%B1%DB%8C/
https://ujjwalkarn.me/2016/08/11/intuitive-explanation-convnets/
60Introduction To Using TensorFlow
Reference
61Introduction To Using TensorFlow
https://www.youtube.com/watch?v=FmpDIaiMIeA
https://www.youtube.com/watch?v=2-Ol7ZB0MmU
https://brohrer.github.io/how_convolutional_neural_networks_work.html
http://www.rtc.us.es/nullhop-a-flexible-convolutional-neural-network-accelerator-
based-on-sparse-representations-of-feature-maps/

More Related Content

What's hot

TensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache SparkTensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache SparkDatabricks
 
Machine learning at scale with Google Cloud Platform
Machine learning at scale with Google Cloud PlatformMachine learning at scale with Google Cloud Platform
Machine learning at scale with Google Cloud PlatformMatthias Feys
 
An Introduction to TensorFlow architecture
An Introduction to TensorFlow architectureAn Introduction to TensorFlow architecture
An Introduction to TensorFlow architectureMani Goswami
 
TensorFlow and Keras: An Overview
TensorFlow and Keras: An OverviewTensorFlow and Keras: An Overview
TensorFlow and Keras: An OverviewPoo Kuan Hoong
 
Deep learning with Tensorflow in R
Deep learning with Tensorflow in RDeep learning with Tensorflow in R
Deep learning with Tensorflow in Rmikaelhuss
 
Neural networks and google tensor flow
Neural networks and google tensor flowNeural networks and google tensor flow
Neural networks and google tensor flowShannon McCormick
 
Spark Meetup TensorFrames
Spark Meetup TensorFramesSpark Meetup TensorFrames
Spark Meetup TensorFramesJen Aman
 
Advanced Spark and TensorFlow Meetup May 26, 2016
Advanced Spark and TensorFlow Meetup May 26, 2016Advanced Spark and TensorFlow Meetup May 26, 2016
Advanced Spark and TensorFlow Meetup May 26, 2016Chris Fregly
 
First steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with ExamplesFirst steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with ExamplesFelipe
 
Deep-Dive into Deep Learning Pipelines with Sue Ann Hong and Tim Hunter
Deep-Dive into Deep Learning Pipelines with Sue Ann Hong and Tim HunterDeep-Dive into Deep Learning Pipelines with Sue Ann Hong and Tim Hunter
Deep-Dive into Deep Learning Pipelines with Sue Ann Hong and Tim HunterDatabricks
 
Common Design of Deep Learning Frameworks
Common Design of Deep Learning FrameworksCommon Design of Deep Learning Frameworks
Common Design of Deep Learning FrameworksKenta Oono
 
Multithreading to Construct Neural Networks
Multithreading to Construct Neural NetworksMultithreading to Construct Neural Networks
Multithreading to Construct Neural NetworksAltoros
 
ML6 talk at Nexxworks Bootcamp
ML6 talk at Nexxworks BootcampML6 talk at Nexxworks Bootcamp
ML6 talk at Nexxworks BootcampKarel Dumon
 
Tensorflow 101 @ Machine Learning Innovation Summit SF June 6, 2017
Tensorflow 101 @ Machine Learning Innovation Summit SF June 6, 2017Tensorflow 101 @ Machine Learning Innovation Summit SF June 6, 2017
Tensorflow 101 @ Machine Learning Innovation Summit SF June 6, 2017Ashish Bansal
 
Teaching Recurrent Neural Networks using Tensorflow (May 2016)
Teaching Recurrent Neural Networks using Tensorflow (May 2016)Teaching Recurrent Neural Networks using Tensorflow (May 2016)
Teaching Recurrent Neural Networks using Tensorflow (May 2016)Rajiv Shah
 

What's hot (19)

TensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache SparkTensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache Spark
 
Machine learning at scale with Google Cloud Platform
Machine learning at scale with Google Cloud PlatformMachine learning at scale with Google Cloud Platform
Machine learning at scale with Google Cloud Platform
 
Introduction to TensorFlow
Introduction to TensorFlowIntroduction to TensorFlow
Introduction to TensorFlow
 
An Introduction to TensorFlow architecture
An Introduction to TensorFlow architectureAn Introduction to TensorFlow architecture
An Introduction to TensorFlow architecture
 
TensorFlow and Keras: An Overview
TensorFlow and Keras: An OverviewTensorFlow and Keras: An Overview
TensorFlow and Keras: An Overview
 
Deep learning with Tensorflow in R
Deep learning with Tensorflow in RDeep learning with Tensorflow in R
Deep learning with Tensorflow in R
 
Neural networks and google tensor flow
Neural networks and google tensor flowNeural networks and google tensor flow
Neural networks and google tensor flow
 
Spark Meetup TensorFrames
Spark Meetup TensorFramesSpark Meetup TensorFrames
Spark Meetup TensorFrames
 
TensorFlow
TensorFlowTensorFlow
TensorFlow
 
Meetup tensorframes
Meetup tensorframesMeetup tensorframes
Meetup tensorframes
 
Advanced Spark and TensorFlow Meetup May 26, 2016
Advanced Spark and TensorFlow Meetup May 26, 2016Advanced Spark and TensorFlow Meetup May 26, 2016
Advanced Spark and TensorFlow Meetup May 26, 2016
 
First steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with ExamplesFirst steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with Examples
 
Deep-Dive into Deep Learning Pipelines with Sue Ann Hong and Tim Hunter
Deep-Dive into Deep Learning Pipelines with Sue Ann Hong and Tim HunterDeep-Dive into Deep Learning Pipelines with Sue Ann Hong and Tim Hunter
Deep-Dive into Deep Learning Pipelines with Sue Ann Hong and Tim Hunter
 
Common Design of Deep Learning Frameworks
Common Design of Deep Learning FrameworksCommon Design of Deep Learning Frameworks
Common Design of Deep Learning Frameworks
 
Multithreading to Construct Neural Networks
Multithreading to Construct Neural NetworksMultithreading to Construct Neural Networks
Multithreading to Construct Neural Networks
 
Åsted .Net (CSI .Net)
Åsted .Net (CSI .Net)Åsted .Net (CSI .Net)
Åsted .Net (CSI .Net)
 
ML6 talk at Nexxworks Bootcamp
ML6 talk at Nexxworks BootcampML6 talk at Nexxworks Bootcamp
ML6 talk at Nexxworks Bootcamp
 
Tensorflow 101 @ Machine Learning Innovation Summit SF June 6, 2017
Tensorflow 101 @ Machine Learning Innovation Summit SF June 6, 2017Tensorflow 101 @ Machine Learning Innovation Summit SF June 6, 2017
Tensorflow 101 @ Machine Learning Innovation Summit SF June 6, 2017
 
Teaching Recurrent Neural Networks using Tensorflow (May 2016)
Teaching Recurrent Neural Networks using Tensorflow (May 2016)Teaching Recurrent Neural Networks using Tensorflow (May 2016)
Teaching Recurrent Neural Networks using Tensorflow (May 2016)
 

Similar to Introduction To Using TensorFlow & Deep Learning

TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...Simplilearn
 
TensorFlow example for AI Ukraine2016
TensorFlow example  for AI Ukraine2016TensorFlow example  for AI Ukraine2016
TensorFlow example for AI Ukraine2016Andrii Babii
 
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...Simplilearn
 
Neural Networks with Google TensorFlow
Neural Networks with Google TensorFlowNeural Networks with Google TensorFlow
Neural Networks with Google TensorFlowDarshan Patel
 
Deep Learning in your Browser: powered by WebGL
Deep Learning in your Browser: powered by WebGLDeep Learning in your Browser: powered by WebGL
Deep Learning in your Browser: powered by WebGLOswald Campesato
 
TensorFlow in Your Browser
TensorFlow in Your BrowserTensorFlow in Your Browser
TensorFlow in Your BrowserOswald Campesato
 
Introduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlowIntroduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlowOswald Campesato
 
Introduction To TensorFlow | Deep Learning with TensorFlow | TensorFlow For B...
Introduction To TensorFlow | Deep Learning with TensorFlow | TensorFlow For B...Introduction To TensorFlow | Deep Learning with TensorFlow | TensorFlow For B...
Introduction To TensorFlow | Deep Learning with TensorFlow | TensorFlow For B...Edureka!
 
Language translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlowLanguage translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlowS N
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Ganesan Narayanasamy
 
Deep Learning in Your Browser
Deep Learning in Your BrowserDeep Learning in Your Browser
Deep Learning in Your BrowserOswald Campesato
 
Intro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.jsIntro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.jsOswald Campesato
 
Lecture Note DL&NN Tensorflow.pptx
Lecture Note DL&NN Tensorflow.pptxLecture Note DL&NN Tensorflow.pptx
Lecture Note DL&NN Tensorflow.pptxBhaviniBhatt7
 
Java and Deep Learning (Introduction)
Java and Deep Learning (Introduction)Java and Deep Learning (Introduction)
Java and Deep Learning (Introduction)Oswald Campesato
 
Deep Learning and TensorFlow
Deep Learning and TensorFlowDeep Learning and TensorFlow
Deep Learning and TensorFlowOswald Campesato
 
Tensorflow - Intro (2017)
Tensorflow - Intro (2017)Tensorflow - Intro (2017)
Tensorflow - Intro (2017)Alessio Tonioni
 
Introduction to Deep Learning, Keras, and Tensorflow
Introduction to Deep Learning, Keras, and TensorflowIntroduction to Deep Learning, Keras, and Tensorflow
Introduction to Deep Learning, Keras, and TensorflowOswald Campesato
 
Introduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlowIntroduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlowSri Ambati
 
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...Databricks
 

Similar to Introduction To Using TensorFlow & Deep Learning (20)

TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
 
TensorFlow example for AI Ukraine2016
TensorFlow example  for AI Ukraine2016TensorFlow example  for AI Ukraine2016
TensorFlow example for AI Ukraine2016
 
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
 
Neural Networks with Google TensorFlow
Neural Networks with Google TensorFlowNeural Networks with Google TensorFlow
Neural Networks with Google TensorFlow
 
Deep Learning in your Browser: powered by WebGL
Deep Learning in your Browser: powered by WebGLDeep Learning in your Browser: powered by WebGL
Deep Learning in your Browser: powered by WebGL
 
TensorFlow in Your Browser
TensorFlow in Your BrowserTensorFlow in Your Browser
TensorFlow in Your Browser
 
Introduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlowIntroduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlow
 
Introduction To TensorFlow | Deep Learning with TensorFlow | TensorFlow For B...
Introduction To TensorFlow | Deep Learning with TensorFlow | TensorFlow For B...Introduction To TensorFlow | Deep Learning with TensorFlow | TensorFlow For B...
Introduction To TensorFlow | Deep Learning with TensorFlow | TensorFlow For B...
 
Language translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlowLanguage translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlow
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117
 
Deep Learning in Your Browser
Deep Learning in Your BrowserDeep Learning in Your Browser
Deep Learning in Your Browser
 
Intro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.jsIntro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.js
 
Lecture Note DL&NN Tensorflow.pptx
Lecture Note DL&NN Tensorflow.pptxLecture Note DL&NN Tensorflow.pptx
Lecture Note DL&NN Tensorflow.pptx
 
Java and Deep Learning (Introduction)
Java and Deep Learning (Introduction)Java and Deep Learning (Introduction)
Java and Deep Learning (Introduction)
 
Deep Learning and TensorFlow
Deep Learning and TensorFlowDeep Learning and TensorFlow
Deep Learning and TensorFlow
 
Tensorflow - Intro (2017)
Tensorflow - Intro (2017)Tensorflow - Intro (2017)
Tensorflow - Intro (2017)
 
TensorFlow.pptx
TensorFlow.pptxTensorFlow.pptx
TensorFlow.pptx
 
Introduction to Deep Learning, Keras, and Tensorflow
Introduction to Deep Learning, Keras, and TensorflowIntroduction to Deep Learning, Keras, and Tensorflow
Introduction to Deep Learning, Keras, and Tensorflow
 
Introduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlowIntroduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlow
 
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
 

Recently uploaded

100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad EscortsCall girls in Ahmedabad High profile
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一ffjhghh
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
 

Recently uploaded (20)

100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
(ISHITA) Call Girls Service Hyderabad Call Now 8617697112 Hyderabad Escorts
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
 

Introduction To Using TensorFlow & Deep Learning

  • 1. Presentation by: In the name of God Professor : 1 Introduction To Using TensorFlow
  • 2. 2Introduction To Using TensorFlow Overview ■ TensorFlow – What is TensorFlow – TensorFlow Code Basics – TensorFlow UseCase ■ Deep Learning – CNN & RNN – Exmple of Mnist Data Set Classification
  • 3. What is TensorFlow 3Introduction To Using TensorFlow What are Tensors? As shown in the image above, tensors are just multidimensional arrays, that allows you to represent data having higher dimensions. 9 … 0
  • 4. What is TensorFlow ■ VGG Network ■ Plain Network ■ Residual Network ■ Experiments ■ Conclusion Network 4Introduction To Using TensorFlow What are Tensors & Flow? In fact, the name “TensorFlow” has been derived from the operations which neural networks perform on tensors. TensorFlow is a library based on Python that provides different types of functionality for implementing Deep Learning Models. the term TensorFlow is made up of two terms – Tensor & Flow:
  • 5. What is TensorFlow 5Introduction To Using TensorFlow TensorFlow (data flow) graph
  • 6. TensorFlow Code Basics 6Introduction To Using TensorFlow ■ Basically, the overall process of writing a TensorFlow program involves two steps: ■ Building a Computational Graph ■ Running a Computational Graph Let me explain you the above two steps one by one:
  • 7. TensorFlow Code Basics 7Introduction To Using TensorFlow ■ Building & Running The Computational Graph ■ Example: Tensor & Flow OR Data & Flow import tensorflow as tf # Build a graph a = tf.constant(8.0) b = tf.constant(9.0) c = a * b # Create the session object sess = tf.Session() output_c = sess.run(c) print(output_c) sess.close()
  • 8. What is TensorFlow 8Introduction To Using TensorFlow  Main Components of Tensorflow: A. Variables: Retain values between sessions, use for weights/bias B. Nodes: The operations C. Tensors: Signals that pass from/to nodes D. Placeholders: Used to send data between your program and the tensorflow graph E. Session: Place when graph is executed. Points to Remember about placeholders: •Placeholders are not initialized and contains no data. •One must provides inputs or feeds to the placeholder which are considered during runtime. •Executing a placeholder without input generates an error.
  • 9. TensorFlow Code Basics 9Introduction To Using TensorFlow ■ Building & Running The Computational Graph ■ Constants, Placeholder and Variables import tensorflow as tf # Creating placeholders a = tf. placeholder(tf.float32) b = tf. placeholder(tf.float32) # Assigning multiplication operation w.r.t. a & b to node mul mul = a*b # Create session object sess = tf.Session() # Executing mul by passing the values [1, 3] [2, 4] for a and b respectively output = sess.run(mul, {a: [1,3], b: [2, 4]}) print('Multiplying a b:', output) Output: [2. 12.]
  • 10. TensorFlow Code Basics 10Introduction To Using TensorFlow ■ Example : Linear Regression on tensorflow
  • 11. TensorFlow Code Basics 11Introduction To Using TensorFlow ■ Example : Linear Regression on tensorflow
  • 12. TensorFlow Code Basics 12Introduction To Using TensorFlow ■ Example : Linear Regression on tensorflow
  • 13. TensorFlow Code Basics 13Introduction To Using TensorFlow ■ Example : Linear Regression on tensorflow
  • 14. TensorFlow Code Basics 14Introduction To Using TensorFlow ■ Example : Linear Regression on tensorflow
  • 15. 15Introduction To Using TensorFlow Deep Learning CNN & RNN
  • 16. Artificial Intelligence 16Introduction To Using TensorFlow Deep Learning & Machine Learning
  • 17. Deep Learning 17Introduction To Using TensorFlow ■ Deep Learning vs Machine Learning
  • 18. Deep Learning 18Introduction To Using TensorFlow ■ Deep Learning with Neural Network
  • 19. Deep Learning 19Introduction To Using TensorFlow ■ Deep Learning with Neural Network
  • 20. Deep Learning 20Introduction To Using TensorFlow ■ Deep Learning with Neural Network
  • 21. TensorFlow Code Basics 21Introduction To Using TensorFlow ■ Example of Neural Network:
  • 22. Deep Learning 22Introduction To Using TensorFlow ■ Neural Network (NN) Forward Pass Backward Pass
  • 23. Deep Learning 23Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN) The three main processing stages in a CNN
  • 24. Deep Learning 24Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN)
  • 25. Deep Learning 25Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN) Example filters learned by Krizhevsky et al. Each of the 96 filters shown here is of size [11x11x3], and each one is shared by the 55*55 neurons in one depth slice. 1 2 3
  • 26. Deep Learning 26Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN)
  • 27. Deep Learning 27Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN)
  • 28. Deep Learning 28Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN)
  • 29. Deep Learning 29Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN)
  • 30. Deep Learning 30Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN) Denoising
  • 31. Deep Learning 31Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN)
  • 32. Deep Learning 32Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN)
  • 33. Deep Learning 33Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN)
  • 34. Deep Learning 34Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN)
  • 35. Deep Learning 35Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN)
  • 36. Deep Learning 36Introduction To Using TensorFlow ■ Convolutional Neural Network (CNN) http://scs.ryerson.ca/~aharley/vis/conv/The three main processing stages in a CNN
  • 37. Deep Learning 37Introduction To Using TensorFlow ■ Example :
  • 38. Deep Learning 38Introduction To Using TensorFlow ■ Example :
  • 39. Deep Learning 39Introduction To Using TensorFlow ■ Example :
  • 40. TensorFlow Code Basics 40Introduction To Using TensorFlow ■ Example : Multi Layer Perceptron MNIST on tensorflow The MNIST database (Modified National Institute of Standards and Technology database) is a large database of handwritten digits that is commonly used for training various image processing systems.
  • 41. TensorFlow Code Basics 41Introduction To Using TensorFlow ■ Example : Multi Layer Perceptron MNIST on tensorflow 1. Load tensorflow library and MNIST data 2. Neural network parameters 3. Build graph 4. Initialize weights and construct the model 5. Define Loss function, and Optimizer 6. Launch graph
  • 42. TensorFlow Code Basics 42Introduction To Using TensorFlow # Parameters learning_rate = 0.001 training_epochs = 15 batch_size = 100 # Network Parameters n_hidden_1 = 256 n_hidden_2 = 256 n_input = 784 n_classes = 10 # On this case we choose the AdamOptimizer optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost) # Cross entropy loss function cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(pred, y)) ■ Example :
  • 43. TensorFlow Code Basics 43Introduction To Using TensorFlow ■ Example : Multi Layer Perceptron MNIST on tensorflow 1. Load tensorflow library and MNIST data import tensorflow as tf # Import MNIST data from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("/tmp/data/", one_hot=True) print('Test shape:',mnist.test.images.shape) print('Train shape:',mnist.train.images.shape) Test shape: (10000, 784) Train shape: (55000, 784)
  • 44. TensorFlow Code Basics 44Introduction To Using TensorFlow ■ Example : Multi Layer Perceptron MNIST on tensorflow # Parameters learning_rate = 0.001 training_epochs = 15 batch_size = 100 display_step = 1 # Network Parameters n_hidden_1 = 256 # 1st layer number of features n_hidden_2 = 256 # 2nd layer number of features n_input = 784 # MNIST data input (img shape: 28*28) n_classes = 10 # MNIST total classes (0-9 digits) 2. Neural network parameters
  • 45. TensorFlow Code Basics 45Introduction To Using TensorFlow ■ Example : Multi Layer Perceptron MNIST on tensorflow x = tf.placeholder("float", [None, n_input]) y = tf.placeholder("float", [None, n_classes]) # Create model def multilayer_perceptron(x, weights, biases): print('x:',x.get_shape(),'W1:',weights['h1'].get_shape(),'b1:',biases['b1'].get_shape()) layer_1 = tf.add(tf.matmul(x, weights['h1']), biases['b1']) layer_1 = tf.nn.relu(layer_1) print( 'layer_1:', layer_1.get_shape(), 'W2:', weights['h2'].get_shape(), 'b2:', biases['b2'].get_shape()) layer_2 = tf.add(tf.matmul(layer_1, weights['h2']), biases['b2']) layer_2 = tf.nn.relu(layer_2) print( 'layer_2:', layer_2.get_shape(), 'W3:', weights['out'].get_shape(), 'b3:', biases['out'].get_shape()) out_layer = tf.matmul(layer_2, weights['out']) + biases['out'] print('out_layer:',out_layer.get_shape()) return out_layer 3. Build graph
  • 46. TensorFlow Code Basics 46Introduction To Using TensorFlow ■ Example : Multi Layer Perceptron MNIST on tensorflow # Store layers weight & bias weights = { 'h1': tf.Variable(tf.random_normal([n_input, n_hidden_1])), #784x256 'h2': tf.Variable(tf.random_normal([n_hidden_1, n_hidden_2])), #256x256 'out': tf.Variable(tf.random_normal([n_hidden_2, n_classes])) #256x10 } biases = { 'b1': tf.Variable(tf.random_normal([n_hidden_1])), #256x1 'b2': tf.Variable(tf.random_normal([n_hidden_2])), #256x1 'out': tf.Variable(tf.random_normal([n_classes])) #10x1 } # Construct model pred = multilayer_perceptron(x, weights, biases) 4. Initialize weights and construct the model
  • 47. TensorFlow Code Basics 47Introduction To Using TensorFlow ■ Example : Multi Layer Perceptron MNIST on tensorflow 5. Define Loss function, and Optimizer # Cross entropy loss function cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(pred, y)) # On this case we choose the AdamOptimizer optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)
  • 48. TensorFlow Code Basics 48Introduction To Using TensorFlow ■ Example : Multi Layer Perceptron MNIST on tensorflow 6.1 Launch graph # Initializing the variables init = tf.initialize_all_variables() # Launch the graph with tf.Session() as sess: sess.run(init) # Training cycle for epoch in range(training_epochs): avg_cost = 0. total_batch = int(mnist.train.num_examples/batch_size) # Loop over all batches for i in range(total_batch): batch_x, batch_y = mnist.train.next_batch(batch_size) # Run optimization op (backprop) and cost op (to get loss value) _, c = sess.run([optimizer, cost], feed_dict={x: batch_x, y: batch_y}) # Compute average loss avg_cost += c / total_batch
  • 49. TensorFlow Code Basics 49Introduction To Using TensorFlow ■ Example : Multi Layer Perceptron MNIST on tensorflow 6.2 Launch graph # Display logs per epoch step if epoch % display_step == 0: print ("Epoch:", '%04d' % (epoch+1), "cost=", "{:.9f}".format(avg_cost)) print("Optimization Finished!") # Test model correct_prediction = tf.equal(tf.argmax(pred, 1), tf.argmax(y, 1)) # Calculate accuracy accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float")) # To keep sizes compatible with model print ("Accuracy:", accuracy.eval({x: mnist.test.images, y: mnist.test.labels}))
  • 50. TensorFlow Code Basics 50Introduction To Using TensorFlow ■ Example : Multi Layer Perceptron MNIST on tensorflow 6.2 Output of Execute graph with CNN Epoch: 0001 cost= 152.289635962 Epoch: 0002 cost= 39.134648348 ... Epoch: 0015 cost= 0.850344581 Optimization Finished! Accuracy: 0.9464
  • 51. Deep Learning Layer 51Introduction To Using TensorFlow W Increasing Depth Layer ?Increasing Parameter ? Become Overfit
  • 54. 54Introduction To Using TensorFlow Results :
  • 58. Reference 58Introduction To Using TensorFlow https://www.edureka.co/blog/tensorflow-tutorial/ http://howsam.org/1396/08/11/%D8%A2%D9%85%D9%88%D8%B2%D8%B4- %D8%AA%D9%86%D8%B3%D9%88%D8%B1%D9%81%D9%84%D9%88/ http://www.7khatcode.com/7677/%D8%AA%D9%86%D8%B3%D9%88%D8%B1%D9%81%D9 %84%D9%88-tensorflow-%DA%86%DB%8C%D8%B3%D8%AA%D8%9F https://blog.faradars.org/cnn-convolution-perceptron-neural-network-2/ https://leonardoaraujosantos.gitbooks.io/artificial-inteligence/content/loss-function.html https://medium.com/machine-learning-in-practice/over-150-of-the-best-machine-learning-nlp-and- python-tutorials-ive-found-ffce2939bd78 https://ujjwalkarn.me/2016/08/11/intuitive-explanation-convnets/ http://howsam.org/1396/08/12/%D9%86%D8%B5%D8%A8- %D8%AA%D9%86%D8%B3%D9%88%D8%B1%D9%81%D9%84%D9%88/
  • 59. Reference 59Introduction To Using TensorFlow http://howsam.org/1396/08/16/%D8%B4%D8%B1%D9%88%D8%B9-%DA%A9%D8%A7%D8%B1- %D8%A8%D8%A7-%D8%AA%D9%86%D8%B3%D9%88%D8%B1%D9%81%D9%84%D9%88/ https://stanford.edu/~shervine/l/fa/teaching/cs-229/cheatsheet-supervised-learning https://stanford.edu/~shervine/l/fa/teaching/cs-229/cheatsheet-deep-learning https://stanford.edu/~shervine/l/fa/teaching/cs-229/cheatsheet-machine-learning-tips-and-tricks https://chistio.ir/%D9%BE%D8%B3-%D8%A7%D9%86%D8%AA%D8%B4%D8%A7%D8%B1- %D8%AE%D8%B7%D8%A7-back-propagation-%D8%B4%D8%A8%DA%A9%D9%87- %D8%B9%D8%B5%D8%A8%DB%8C/ http://deeplearning.ir/%D9%BE%DB%8C%D8%B4%DB%8C%D9%86%D9%87-%D9%88- %D9%85%D8%B1%D9%88%D8%B1%DB%8C-%D8%A8%D8%B1- %D8%B1%D9%88%D8%B4%D9%87%D8%A7%DB%8C- %D9%85%D8%AE%D8%AA%D9%84%D9%81- %DB%8C%D8%A7%D8%AF%DA%AF%DB%8C%D8%B1%DB%8C/ https://ujjwalkarn.me/2016/08/11/intuitive-explanation-convnets/
  • 61. Reference 61Introduction To Using TensorFlow https://www.youtube.com/watch?v=FmpDIaiMIeA https://www.youtube.com/watch?v=2-Ol7ZB0MmU https://brohrer.github.io/how_convolutional_neural_networks_work.html http://www.rtc.us.es/nullhop-a-flexible-convolutional-neural-network-accelerator- based-on-sparse-representations-of-feature-maps/