Introduction To Tensorflow
A deep-learning framework
By
Rayyan Khalid
What is a Deep Learning Framework?
“An interface, library or a tool that allows us to build deep-learning model
easily and offers building blocks for designing, training, and validating deep
neural networks”
Building Blocks of a Deep NN
Feed-Forward
Back-Propagation
Computing
Loss
Building Blocks of a Deep NN cont.
● Input Data (X)
● Output (y)
● Hidden Layers
● Neuron
● Activation Functions
● Feed-Forward
● Loss Functions
● Optimizers
● Back-propagation
Choosing a Deep Learning Framework
● GitHub Activity
● Medium Articles
● arXiv Articles
● Books on Amazon
● Number of developers using it
● Google-Searches
● Online jobs posting
Deep Learning Framework Power Scores
Online Jobs Postings
Tensorflow is an undisputed champion
Using Tools Effectively
Traditional Programming Paradigms
VS
Deep Learning Program Paradigms
Traditional Programming vs Deep Learning Programs
Traditional
Programming
Rules
Data
Answers
ML/DL
Programs Rules
Data
Answers
“Hello World” of Neural Network
Consider a function y = f(X) defined by the relation: log(x^2 + x + 1):
“Hello World” of Neural Network cont.
X Y
-10 1.959
-7 1.633
-5 1.3222
-2 0.4771
0 0
2 0.8451
5 1.4914
10 2.04532
“Hello World” of Neural Network cont.
Input Output
Layer-1
Layer-2
Neuron with
tanh
activation
“Hello World” of Neural Network via Tensorflow
model = tf.keras.models.Sequential([tf.keras.layers.Dense(3, activation=tf.nn.tanh, input_shape=[1]),
tf.keras.layers.Dense(2, activation=tf.nn.tanh),
tf.keras.layers.Dense(1,)])
● Sequential: Represents a Feed-Forward-Network
● Dense: Represents a fully connected hidden layer
● Units: Represents the Neurons
Only need to pass in
the first layer
Output Layer
“Hello World” of Neural Network via Tensorflow
model.compile(optimizers="sgd", loss="mean_squared_error")
Model compile method deals with 3 major building blocks:
● Optimizer Functions
● Computing Loss
● Back Propagation
model.fit(x, y, epochs=800)
Model fit method represents your Training Cycle
Let's Move Towards the Demo
https://github.com/rayyan17/Introduction-To-Tensor-Flow.git
Libraries for Tensorflow
● Tensorflow Hub: Provides many pre-trained models
● Hugging Face-Transformers: State of the art Natural Language Processing
for Tensorflow 2.0 and PyTorch
● Google-Colabs
● Tensorflow can be easily integrated with models built on other libraries,
like scikit-learn, gensim, Spacy
● Playground Provided by Tensorflow http://playground.tensorflow.org/
Coursera Specializations:
● Tensorflow in Practice Specialization
● Deep Learning Specialization
Grokking Deep Learning by Andrew Trask
Learning Resources
Thank You

Introduction To Tensorflow

  • 1.
    Introduction To Tensorflow Adeep-learning framework By Rayyan Khalid
  • 2.
    What is aDeep Learning Framework? “An interface, library or a tool that allows us to build deep-learning model easily and offers building blocks for designing, training, and validating deep neural networks”
  • 3.
    Building Blocks ofa Deep NN Feed-Forward Back-Propagation Computing Loss
  • 4.
    Building Blocks ofa Deep NN cont. ● Input Data (X) ● Output (y) ● Hidden Layers ● Neuron ● Activation Functions ● Feed-Forward ● Loss Functions ● Optimizers ● Back-propagation
  • 5.
    Choosing a DeepLearning Framework ● GitHub Activity ● Medium Articles ● arXiv Articles ● Books on Amazon ● Number of developers using it ● Google-Searches ● Online jobs posting
  • 6.
  • 7.
  • 8.
    Tensorflow is anundisputed champion
  • 9.
    Using Tools Effectively TraditionalProgramming Paradigms VS Deep Learning Program Paradigms
  • 10.
    Traditional Programming vsDeep Learning Programs Traditional Programming Rules Data Answers ML/DL Programs Rules Data Answers
  • 11.
    “Hello World” ofNeural Network Consider a function y = f(X) defined by the relation: log(x^2 + x + 1):
  • 12.
    “Hello World” ofNeural Network cont. X Y -10 1.959 -7 1.633 -5 1.3222 -2 0.4771 0 0 2 0.8451 5 1.4914 10 2.04532
  • 13.
    “Hello World” ofNeural Network cont. Input Output Layer-1 Layer-2 Neuron with tanh activation
  • 14.
    “Hello World” ofNeural Network via Tensorflow model = tf.keras.models.Sequential([tf.keras.layers.Dense(3, activation=tf.nn.tanh, input_shape=[1]), tf.keras.layers.Dense(2, activation=tf.nn.tanh), tf.keras.layers.Dense(1,)]) ● Sequential: Represents a Feed-Forward-Network ● Dense: Represents a fully connected hidden layer ● Units: Represents the Neurons Only need to pass in the first layer Output Layer
  • 15.
    “Hello World” ofNeural Network via Tensorflow model.compile(optimizers="sgd", loss="mean_squared_error") Model compile method deals with 3 major building blocks: ● Optimizer Functions ● Computing Loss ● Back Propagation model.fit(x, y, epochs=800) Model fit method represents your Training Cycle
  • 16.
    Let's Move Towardsthe Demo https://github.com/rayyan17/Introduction-To-Tensor-Flow.git
  • 17.
    Libraries for Tensorflow ●Tensorflow Hub: Provides many pre-trained models ● Hugging Face-Transformers: State of the art Natural Language Processing for Tensorflow 2.0 and PyTorch ● Google-Colabs ● Tensorflow can be easily integrated with models built on other libraries, like scikit-learn, gensim, Spacy ● Playground Provided by Tensorflow http://playground.tensorflow.org/
  • 18.
    Coursera Specializations: ● Tensorflowin Practice Specialization ● Deep Learning Specialization Grokking Deep Learning by Andrew Trask Learning Resources
  • 19.

Editor's Notes

  • #10 One of the best way to use these tools effectively, it is best to first understand the basic difference between these 2 different approaches to solve a problem
  • #11 Give the weather forecasting problem example