SlideShare a Scribd company logo
1 – ML/DL Basics
WeCloudData
Outline
• Machine Learning Basics
• Deep Learning History & Basics
• Linear Algebra Basics: From Vector to Tensor
• Linear Regression
• Loss/Cost Function
• Gradient Descent
• Logistic Regression
• Hands-on Lab
• Setting up the Environment
• Graphs and Sessions in Tensorflow
• Creating a Simple Tensorflow Graph
• Visualizing the Graph
• Learning about Constants and Variables
About Me!
Taraneh (Tara) Khazaei
• B.Sc. and M.Sc. in Computer Science
• Ph.D. in Computer Science
■ Machine Learning
■ Natural Language Processing
■ Social Media Analytics
Taraneh (Tara) Khazaei
• Data Scientist/Data Engineer at TD Bank
■ Customer 360
■ Predictive modeling on financial and social media data
• Research Scientist
■ Text mining on call center data
■ Word and graph embedding in the retail context
• Data Scientist/Cloud Architect
■ Clickstream mining
■ Speech/text mining of call center data
About the Course!
Applied Deep Learning
● Lectures + Labs
● NLP and text
● Final project
● NIPS: Neural Information Processing Systems
● ICLR: International Conference on Learning Representations
● ICML: International Conference on Machine Learning
● ACL: Annual Meetings of the Association of Computational Linguistics
● EMNLP: Empirical Methods in Natural Language Processing
About You?!
Machine Learning (ML) Basics: “How do you define ML?”
Machine Learning Basics
• Machine Learning:
• “A computer program is said to learn from experience E with
respect to some class of tasks T and performance
measure P, if its performance at tasks in T, as measured by P,
improves with experience E” [1]
• The Task, T
• The Performance measure, P
• The Experience, E
The Task, T
• Classification: Predict survey results (e.g., satisfied/dissatisfied) after the calls
• Regression: Sales prediction in stormy weather
• Transcription: Speech Recognition and OCR
• Machine translation: Translation from English to French
• Structured output: Grammatical parsing of language
• Anomaly detection: Credit card fraud detection
• Synthesis and sampling: Generation of landscape texture for video games
The Experience, E
• Supervised Learning
• Unsupervised Learning
• Semi-supervised Learning
• Reinforcement Learning
The Experience, E
• Supervised Learning
• Unsupervised Learning
• Semi-supervised Learning
• Reinforcement Learning
Credit
Approval
Age Gender
Annual
Salary
Months in
Residence
Months
in Job
Current
Debt
Paid off
Credit
Client 1 23 M $30,000 36 12 $5,000 Yes
Client 2 30 F $45,000 12 12 $1,000 Yes
Client 3 19 M $15,000 3 1 $10,000 No
Client 4 25 M $25,000 12 27 $15,000 ?
Uses past data to predict future
feature
s
label
The Experience, E
• Supervised Learning
• Unsupervised Learning
• Semi-supervised Learning
• Reinforcement Learning
Credit
Approval
Age Gender
Annual
Salary
Months in
Residence
Months in
Job
Current
Debt
Client 1 23 M $30,000 36 12 $5,000
Client 2 30 F $45,000 12 12 $1,000
Client 3 19 M $15,000 3 1 $10,000
Client 4 25 M $25,000 12 27 $15,000
Finds patterns
features
The Performance Measure, P
• Accuracy: proportion of examples for which the model produces the correct output
• Error rate: the proportion of examples for which the model produces an incorrect
output
• Precision, recall, and F-score
• Mean Square Error:
The Performance Measure, P
• Training/Test split
• N-Fold Cross-Validation
Deep Learning Basics and History
Deep Learning: History
Deep Learning Basics
• Many of the ideas were developed in 80s and 90s, but DL started to take off
~2010, why?
• Large amounts of training data
• Faster machines (CPUs/GPUs)
• New algorithms and ideas
Speech Recognition Vision Text
Perceptron
Processing Unit
x1
x2
y
Perceptron
Processing Unit
x1
x2
y
w1
w2
Perceptron
b
f(x) =
w1x1+w2x2+b
x1
x2
y
w1
w2
Perceptron
f(x) =
w1x1+w2x2+b
w1
w2
b
x1
x2
y
(0, 1)
Perceptron
f(x) =
w1x1+w2x2+b
w1
w2
b
x1
x2
1
y
(0, 1)
Perceptron
w1
w2
b
x1
x2
1
y
(0, 1)
∑
Perceptron
w1
w2
b
yx1
x2
1
∑
w1x1+w2x2+ b
Perceptron
w1
w2
b
yx1
x2
1
∑
w1x1+w2x2+ b
Perceptron
w1
w2
b
yx1
x2
1
∑
w1x1+w2x2+ b
Perceptron
w1
w2
b
yx1
x2
1
∑
w1x1+w2x2+ b
Logistic regression unit
Perceptron
w1
w2
b
yx1
x2
1
∑
Linear Algebra Basics: From Vector To Tensor
Linear Algebra Basics
• Scalar: Just a single number
• Vectors: A vector is an array of numbers arranged in order
• Matrix: A matrix is a 2-D array of numbers, so each element is identified by two
indices instead of just one
Linear Algebra Basics
• Tensors: In some cases we will need an array with more than two axes. In the general
case, an array of numbers arranged on a regular grid with a variable
number of axes is known as a tensor.
Linear Algebra Basics
Linear Regression
Linear Regression
Boston Housing Data
Vector of input features: X
∈ Rn
x(i) : ith row/house/vector
x(i)
j: jth parameter in the ith row
Label: y
y(i): label for
the ith house
Linear Regression
Finding the best fit line?
Linear Regression
Regression Hypothesis
So how do you choose ?
How to choose ‘s ?
Cost Function (Least Squares)
Choose so that is close to
for training examples
Cost Function (Least Squares)
Choose so that is close to
for training examples
Hypothesis:
Parameters:
Cost Function (Least Squares)
Choose so that is close to
for training examples
Hypothesis:
Parameters:
Cost Function:
Goal:
Cost Function
Gradient Descent
Cost Function
After exhaustively trying different values of
we get a contour plot which captures the
relationship between and the cost (error)
Gradient Descent
Takes a step into the steepest downhill direction
Learning Rate
If is too small, gradient descent can
be very slow to converge
Cost
Cost
If is too large, gradient descent can
overshoot the minimum. It may even
fail to converge, or even diverge
Gradient Descent
The idea of gradient descent is to find the
best combination of parameters so that the
cost function can be minimized
Local Minimum
Gradient descent can converge to a
local minimum
local minimum
global minimum
Batch Gradient Descent vs. Stochastic Gradient Descent
Batch Gradient Descent
Each step of gradient descent
(epoch) uses all the training
examples
Takes more passes of the data to
converge
Slower to train
Smaller dataset
Offline learning
Stochastic Gradient Descent
Each step of gradient descent
(epoch) uses only one training
example
Takes less passes of the data to
converge
Faster to train, but oscillate a lot
Large dataset
Online learning
Multivariate Linear Regression
Hypothesis:
Parameters:
Cost Function:
Goal:
Multivariate Linear Regression
For convenience, we can
set
Multivariate Linear Regression
Repeat until convergence {
}
When n = 1
Repeat until convergence {
}
Multivariate Regression (n >> 1)
…
Gradient Descent in Practice
• Feature Scaling (Mean Normalization)
• Scale the features to normal ranges will make
the algorithm converge faster
• Tuning the learning rate
• Tuning the learning rate also controls the
convergence speed of the algorithm
Logistic Regression
Logistic Regression – Cost Function
• Predicts the probability of a particular
data point to a class:
• Supervised learning
• Classification
Sigmoid Function
Perceptron
w1
w2
b
x1
x2
1
y
(0, 1)
∑
Sigmoid Function
TensorFlow: The Basics
Tensorflow
● Google
● NVIDIA
● Intel
● SAP
● eBay
● Airbus
● Uber
● Airbnb
● Snap
● Dropbox
Tensorflow
● Python API
● Portability: deploy computation to one or more CPUs or GPUs in a desktop,
server, or mobile device with a single API
● Flexibility: from Raspberry Pi, Android, Windows, iOS, Linux to server farms
● Visualization via Tensorboard
● Save and restore models and computational graphs
● Large community (~300k commits, ~85k repositories)
● Awesome projects already using TensorFlow
Azure - Data Science VM
Azure - Data Science VM
Alternative: Grab a Linux VM online, install
Python, Tensorflow, and Jupyter and use the
VM locally for free.
Required Libraries
● Python (default): 3.5
● Tensorflow (Tensorboard): 1.6.0
● Jupyter: 5.4.1
Required Libraries
● Python (default): 3.5
● Tensorflow (Tensorboard): 1.6.0
● Jupyter: 5.4.1
ssh -L 8888:localhost:8888 user@example.com
Tensorflow
Tensorflow separates definitions of computations from their
execution:
● Define a graph of computations in Python
● Use a session to execute operations in the graph
● Tensorflow runs the graph using a optimized C++ code
import tensorflow as tf
a = tf.add(3, 5)
Tensorflow
Tensorflow separates definitions of computations from their
execution:
● Define a graph of computations in Python
● Use a session to execute operations in the graph
● Tensorflow runs the graph using a optimized C++ code
import tensorflow as tf
a = tf.add(3, 5)
Tensorflow
Separates definitions of computations from their execution:
● Define a graph of computations in Python
● Use a session to execute operations in the graph
○ Create a session, assign it to a variable so we can call it later
○ Within the session, evaluate the graph to fetch the value of a
import tensorflow as tf
a = tf.add(3, 5)
sess = tf.Session()
print(sess.run(a))
sess.close()
Tensorflow
Separates definitions of computations from their execution:
● Define a graph of computations in Python
● Use a session to execute operations in the graph
○ Create a session, assign it to a variable so we can call it later
○ Within the session, evaluate the graph to fetch the value of a
import tensorflow as tf
a = tf.add(3, 5)
with tf.Session() as sess:
print(sess.run(a))
Tensorflow
x = 2
y = 3
op1 = tf.add(x, y)
op2 = tf.multiply(x, y)
op3 = tf.pow(op2, op1)
with tf.Session() as sess:
op3 = sess.run(op3)
Tensorflow
x = 2
y = 3
op1 = tf.add(x, y)
op2 = tf.multiply(x, y)
op3 = tf.pow(op2, op1)
writer = tf.summary.FileWriter('./graphs',
tf.get_default_graph())
with tf.Session() as sess:
writer = tf.summary.FileWriter('./graphs', sess.graph)
op3 = sess.run(op3)
writer.close()
Tensorflow
x = 2
y = 3
op1 = tf.add(x, y)
op2 = tf.multiply(x, y)
op3 = tf.pow(op2, op1)
writer = tf.summary.FileWriter('./graphs',
tf.get_default_graph())
with tf.Session() as sess:
#writer = tf.summary.FileWriter('./graphs', sess.graph)
op3 = sess.run(op3)
writer.close()
Tensorflow
x = tf.constant(2, name='a')
y = tf.constant(3, name ='b')
op1 = tf.add(x, y)
op2 = tf.multiply(x, y)
op3 = tf.pow(op2, op1)
writer = tf.summary.FileWriter('./graphs',
tf.get_default_graph())
with tf.Session() as sess:
#writer = tf.summary.FileWriter('./graphs', sess.graph)
op3 = sess.run(op3)
writer.close()
tf.constant(
value,
dtype=None,
shape=None,
name='Const',
verify_shape=False
)
Tensorflow tf.constant(
value,
dtype=None,
shape=None,
name='Const',
verify_shape=False
)
Tensorflow
Tensorflow
x = tf.constant(2, name='a')
y = tf.constant(3, name ='b')
op1 = tf.add(x, y, name='add')
op2 = tf.multiply(x, y, name='multiply')
op3 = tf.pow(op2, op1, name='power')
writer = tf.summary.FileWriter('./graphs',
tf.get_default_graph())
with tf.Session() as sess:
#writer = tf.summary.FileWriter('./graphs', sess.graph)
op3 = sess.run(op3)
writer.close()
Tensorflow
tensorboard --logdir="./graphs" --port 6006
Port forwarding to your machine:
ssh -L 6006:localhost:6006 user@example.com
Final Project
Final Project
Thank you
Ad

More Related Content

What's hot (16)

Tensors Are All You Need: Faster Inference with Hummingbird
Tensors Are All You Need: Faster Inference with HummingbirdTensors Are All You Need: Faster Inference with Hummingbird
Tensors Are All You Need: Faster Inference with Hummingbird
Databricks
 
Aditya Bhattacharya - Enterprise DL - Accelerating Deep Learning Solutions to...
Aditya Bhattacharya - Enterprise DL - Accelerating Deep Learning Solutions to...Aditya Bhattacharya - Enterprise DL - Accelerating Deep Learning Solutions to...
Aditya Bhattacharya - Enterprise DL - Accelerating Deep Learning Solutions to...
Aditya Bhattacharya
 
DATA SCIENCE TRAINING IN CHENNAI
DATA SCIENCE TRAINING IN CHENNAIDATA SCIENCE TRAINING IN CHENNAI
DATA SCIENCE TRAINING IN CHENNAI
shivajirao12345
 
Azure Machine Learning and ML on Premises
Azure Machine Learning and ML on PremisesAzure Machine Learning and ML on Premises
Azure Machine Learning and ML on Premises
Ivo Andreev
 
Machine Learning with JavaScript
Machine Learning with JavaScriptMachine Learning with JavaScript
Machine Learning with JavaScript
Ivo Andreev
 
Intro to graphs for HR analytics
Intro to graphs for HR analyticsIntro to graphs for HR analytics
Intro to graphs for HR analytics
Rik Van Bruggen
 
MLCommons: Better ML for Everyone
MLCommons: Better ML for EveryoneMLCommons: Better ML for Everyone
MLCommons: Better ML for Everyone
Databricks
 
Made to Measure: Ranking Evaluation using Elasticsearch
Made to Measure: Ranking Evaluation using ElasticsearchMade to Measure: Ranking Evaluation using Elasticsearch
Made to Measure: Ranking Evaluation using Elasticsearch
Daniel Schneiter
 
20141216 graph database prototyping ams meetup
20141216 graph database prototyping ams meetup20141216 graph database prototyping ams meetup
20141216 graph database prototyping ams meetup
Rik Van Bruggen
 
Getting Started With Dato - August 2015
Getting Started With Dato - August 2015Getting Started With Dato - August 2015
Getting Started With Dato - August 2015
Turi, Inc.
 
Spark Summit EU 2017 - Preventing revenue leakage and monitoring distributed ...
Spark Summit EU 2017 - Preventing revenue leakage and monitoring distributed ...Spark Summit EU 2017 - Preventing revenue leakage and monitoring distributed ...
Spark Summit EU 2017 - Preventing revenue leakage and monitoring distributed ...
Flavio Clesio
 
Machine learning and Deep learning on edge devices using TensorFlow
Machine learning and Deep learning on edge devices using TensorFlowMachine learning and Deep learning on edge devices using TensorFlow
Machine learning and Deep learning on edge devices using TensorFlow
Aditya Bhattacharya
 
Using graphs for recommendations
Using graphs for recommendationsUsing graphs for recommendations
Using graphs for recommendations
Rik Van Bruggen
 
Production ready big ml workflows from zero to hero daniel marcous @ waze
Production ready big ml workflows from zero to hero daniel marcous @ wazeProduction ready big ml workflows from zero to hero daniel marcous @ waze
Production ready big ml workflows from zero to hero daniel marcous @ waze
Ido Shilon
 
Automatic machine learning (AutoML) 101
Automatic machine learning (AutoML) 101Automatic machine learning (AutoML) 101
Automatic machine learning (AutoML) 101
QuantUniversity
 
FlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaFlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at Humana
Databricks
 
Tensors Are All You Need: Faster Inference with Hummingbird
Tensors Are All You Need: Faster Inference with HummingbirdTensors Are All You Need: Faster Inference with Hummingbird
Tensors Are All You Need: Faster Inference with Hummingbird
Databricks
 
Aditya Bhattacharya - Enterprise DL - Accelerating Deep Learning Solutions to...
Aditya Bhattacharya - Enterprise DL - Accelerating Deep Learning Solutions to...Aditya Bhattacharya - Enterprise DL - Accelerating Deep Learning Solutions to...
Aditya Bhattacharya - Enterprise DL - Accelerating Deep Learning Solutions to...
Aditya Bhattacharya
 
DATA SCIENCE TRAINING IN CHENNAI
DATA SCIENCE TRAINING IN CHENNAIDATA SCIENCE TRAINING IN CHENNAI
DATA SCIENCE TRAINING IN CHENNAI
shivajirao12345
 
Azure Machine Learning and ML on Premises
Azure Machine Learning and ML on PremisesAzure Machine Learning and ML on Premises
Azure Machine Learning and ML on Premises
Ivo Andreev
 
Machine Learning with JavaScript
Machine Learning with JavaScriptMachine Learning with JavaScript
Machine Learning with JavaScript
Ivo Andreev
 
Intro to graphs for HR analytics
Intro to graphs for HR analyticsIntro to graphs for HR analytics
Intro to graphs for HR analytics
Rik Van Bruggen
 
MLCommons: Better ML for Everyone
MLCommons: Better ML for EveryoneMLCommons: Better ML for Everyone
MLCommons: Better ML for Everyone
Databricks
 
Made to Measure: Ranking Evaluation using Elasticsearch
Made to Measure: Ranking Evaluation using ElasticsearchMade to Measure: Ranking Evaluation using Elasticsearch
Made to Measure: Ranking Evaluation using Elasticsearch
Daniel Schneiter
 
20141216 graph database prototyping ams meetup
20141216 graph database prototyping ams meetup20141216 graph database prototyping ams meetup
20141216 graph database prototyping ams meetup
Rik Van Bruggen
 
Getting Started With Dato - August 2015
Getting Started With Dato - August 2015Getting Started With Dato - August 2015
Getting Started With Dato - August 2015
Turi, Inc.
 
Spark Summit EU 2017 - Preventing revenue leakage and monitoring distributed ...
Spark Summit EU 2017 - Preventing revenue leakage and monitoring distributed ...Spark Summit EU 2017 - Preventing revenue leakage and monitoring distributed ...
Spark Summit EU 2017 - Preventing revenue leakage and monitoring distributed ...
Flavio Clesio
 
Machine learning and Deep learning on edge devices using TensorFlow
Machine learning and Deep learning on edge devices using TensorFlowMachine learning and Deep learning on edge devices using TensorFlow
Machine learning and Deep learning on edge devices using TensorFlow
Aditya Bhattacharya
 
Using graphs for recommendations
Using graphs for recommendationsUsing graphs for recommendations
Using graphs for recommendations
Rik Van Bruggen
 
Production ready big ml workflows from zero to hero daniel marcous @ waze
Production ready big ml workflows from zero to hero daniel marcous @ wazeProduction ready big ml workflows from zero to hero daniel marcous @ waze
Production ready big ml workflows from zero to hero daniel marcous @ waze
Ido Shilon
 
Automatic machine learning (AutoML) 101
Automatic machine learning (AutoML) 101Automatic machine learning (AutoML) 101
Automatic machine learning (AutoML) 101
QuantUniversity
 
FlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaFlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at Humana
Databricks
 

Similar to Deep Learning Introduction - WeCloudData (20)

Introduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searchingIntroduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searching
Mvenkatarao
 
Analytics Boot Camp - Slides
Analytics Boot Camp - SlidesAnalytics Boot Camp - Slides
Analytics Boot Camp - Slides
Aditya Joshi
 
Searching Algorithms
Searching AlgorithmsSearching Algorithms
Searching Algorithms
Afaq Mansoor Khan
 
DeepLearningLecture.pptx
DeepLearningLecture.pptxDeepLearningLecture.pptx
DeepLearningLecture.pptx
ssuserf07225
 
Machine Learning with TensorFlow 2
Machine Learning with TensorFlow 2Machine Learning with TensorFlow 2
Machine Learning with TensorFlow 2
Sarah Stemmler
 
مدخل إلى تعلم الآلة
مدخل إلى تعلم الآلةمدخل إلى تعلم الآلة
مدخل إلى تعلم الآلة
Fares Al-Qunaieer
 
Algorithms
Algorithms Algorithms
Algorithms
yashodhaHR2
 
Practical deep learning for computer vision
Practical deep learning for computer visionPractical deep learning for computer vision
Practical deep learning for computer vision
Eran Shlomo
 
Tensorflow
TensorflowTensorflow
Tensorflow
marwa Ayad Mohamed
 
in computer data structures and algorithms
in computer data structures and algorithmsin computer data structures and algorithms
in computer data structures and algorithms
FIONACHATOLA
 
BCS401 ADA First IA Test Question Bank.pdf
BCS401 ADA First IA Test Question Bank.pdfBCS401 ADA First IA Test Question Bank.pdf
BCS401 ADA First IA Test Question Bank.pdf
VENKATESHBHAT25
 
Keynote at IWLS 2017
Keynote at IWLS 2017Keynote at IWLS 2017
Keynote at IWLS 2017
Manish Pandey
 
Unsupervised Learning: Clustering
Unsupervised Learning: Clustering Unsupervised Learning: Clustering
Unsupervised Learning: Clustering
Experfy
 
Machine Learning, Deep Learning and Data Analysis Introduction
Machine Learning, Deep Learning and Data Analysis IntroductionMachine Learning, Deep Learning and Data Analysis Introduction
Machine Learning, Deep Learning and Data Analysis Introduction
Te-Yen Liu
 
Lecture 1 and 2 of Data Structures & Algorithms
Lecture 1 and 2 of Data Structures & AlgorithmsLecture 1 and 2 of Data Structures & Algorithms
Lecture 1 and 2 of Data Structures & Algorithms
haseebanjum2611
 
Introduction to Machine Learning with Spark
Introduction to Machine Learning with SparkIntroduction to Machine Learning with Spark
Introduction to Machine Learning with Spark
datamantra
 
C++ Notes PPT.ppt
C++ Notes PPT.pptC++ Notes PPT.ppt
C++ Notes PPT.ppt
Alpha474815
 
lecture1.ppt
lecture1.pptlecture1.ppt
lecture1.ppt
SagarDR5
 
Data Structure - Lecture 1 - Introduction.pdf
Data Structure  - Lecture 1 - Introduction.pdfData Structure  - Lecture 1 - Introduction.pdf
Data Structure - Lecture 1 - Introduction.pdf
donotreply20
 
AoA Lec Design of algorithm spresentation
AoA Lec Design of algorithm spresentationAoA Lec Design of algorithm spresentation
AoA Lec Design of algorithm spresentation
HamzaSadaat
 
Introduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searchingIntroduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searching
Mvenkatarao
 
Analytics Boot Camp - Slides
Analytics Boot Camp - SlidesAnalytics Boot Camp - Slides
Analytics Boot Camp - Slides
Aditya Joshi
 
DeepLearningLecture.pptx
DeepLearningLecture.pptxDeepLearningLecture.pptx
DeepLearningLecture.pptx
ssuserf07225
 
Machine Learning with TensorFlow 2
Machine Learning with TensorFlow 2Machine Learning with TensorFlow 2
Machine Learning with TensorFlow 2
Sarah Stemmler
 
مدخل إلى تعلم الآلة
مدخل إلى تعلم الآلةمدخل إلى تعلم الآلة
مدخل إلى تعلم الآلة
Fares Al-Qunaieer
 
Practical deep learning for computer vision
Practical deep learning for computer visionPractical deep learning for computer vision
Practical deep learning for computer vision
Eran Shlomo
 
in computer data structures and algorithms
in computer data structures and algorithmsin computer data structures and algorithms
in computer data structures and algorithms
FIONACHATOLA
 
BCS401 ADA First IA Test Question Bank.pdf
BCS401 ADA First IA Test Question Bank.pdfBCS401 ADA First IA Test Question Bank.pdf
BCS401 ADA First IA Test Question Bank.pdf
VENKATESHBHAT25
 
Keynote at IWLS 2017
Keynote at IWLS 2017Keynote at IWLS 2017
Keynote at IWLS 2017
Manish Pandey
 
Unsupervised Learning: Clustering
Unsupervised Learning: Clustering Unsupervised Learning: Clustering
Unsupervised Learning: Clustering
Experfy
 
Machine Learning, Deep Learning and Data Analysis Introduction
Machine Learning, Deep Learning and Data Analysis IntroductionMachine Learning, Deep Learning and Data Analysis Introduction
Machine Learning, Deep Learning and Data Analysis Introduction
Te-Yen Liu
 
Lecture 1 and 2 of Data Structures & Algorithms
Lecture 1 and 2 of Data Structures & AlgorithmsLecture 1 and 2 of Data Structures & Algorithms
Lecture 1 and 2 of Data Structures & Algorithms
haseebanjum2611
 
Introduction to Machine Learning with Spark
Introduction to Machine Learning with SparkIntroduction to Machine Learning with Spark
Introduction to Machine Learning with Spark
datamantra
 
C++ Notes PPT.ppt
C++ Notes PPT.pptC++ Notes PPT.ppt
C++ Notes PPT.ppt
Alpha474815
 
lecture1.ppt
lecture1.pptlecture1.ppt
lecture1.ppt
SagarDR5
 
Data Structure - Lecture 1 - Introduction.pdf
Data Structure  - Lecture 1 - Introduction.pdfData Structure  - Lecture 1 - Introduction.pdf
Data Structure - Lecture 1 - Introduction.pdf
donotreply20
 
AoA Lec Design of algorithm spresentation
AoA Lec Design of algorithm spresentationAoA Lec Design of algorithm spresentation
AoA Lec Design of algorithm spresentation
HamzaSadaat
 
Ad

More from WeCloudData (13)

Data Engineer Intro - WeCloudData
Data Engineer Intro - WeCloudDataData Engineer Intro - WeCloudData
Data Engineer Intro - WeCloudData
WeCloudData
 
AWS Well Architected-Info Session WeCloudData
AWS Well Architected-Info Session WeCloudDataAWS Well Architected-Info Session WeCloudData
AWS Well Architected-Info Session WeCloudData
WeCloudData
 
Data Engineering Course Syllabus - WeCloudData
Data Engineering Course Syllabus - WeCloudDataData Engineering Course Syllabus - WeCloudData
Data Engineering Course Syllabus - WeCloudData
WeCloudData
 
Machine learning in Healthcare - WeCloudData
Machine learning in Healthcare - WeCloudDataMachine learning in Healthcare - WeCloudData
Machine learning in Healthcare - WeCloudData
WeCloudData
 
Big Data for Data Scientists - WeCloudData
Big Data for Data Scientists - WeCloudDataBig Data for Data Scientists - WeCloudData
Big Data for Data Scientists - WeCloudData
WeCloudData
 
Introduction to Python by WeCloudData
Introduction to Python by WeCloudDataIntroduction to Python by WeCloudData
Introduction to Python by WeCloudData
WeCloudData
 
Data Science Career Insights by WeCloudData
Data Science Career Insights by WeCloudDataData Science Career Insights by WeCloudData
Data Science Career Insights by WeCloudData
WeCloudData
 
Web scraping project aritza-compressed
Web scraping project   aritza-compressedWeb scraping project   aritza-compressed
Web scraping project aritza-compressed
WeCloudData
 
Applied Machine Learning Course - Jodie Zhu (WeCloudData)
Applied Machine Learning Course - Jodie Zhu (WeCloudData)Applied Machine Learning Course - Jodie Zhu (WeCloudData)
Applied Machine Learning Course - Jodie Zhu (WeCloudData)
WeCloudData
 
Introduction to Machine Learning - WeCloudData
Introduction to Machine Learning - WeCloudDataIntroduction to Machine Learning - WeCloudData
Introduction to Machine Learning - WeCloudData
WeCloudData
 
Big Data for Data Scientists - Info Session
Big Data for Data Scientists - Info SessionBig Data for Data Scientists - Info Session
Big Data for Data Scientists - Info Session
WeCloudData
 
WeCloudData Toronto Open311 Workshop - Matthew Reyes
WeCloudData Toronto Open311 Workshop - Matthew ReyesWeCloudData Toronto Open311 Workshop - Matthew Reyes
WeCloudData Toronto Open311 Workshop - Matthew Reyes
WeCloudData
 
Tordatasci meetup-precima-retail-analytics-201901
Tordatasci meetup-precima-retail-analytics-201901Tordatasci meetup-precima-retail-analytics-201901
Tordatasci meetup-precima-retail-analytics-201901
WeCloudData
 
Data Engineer Intro - WeCloudData
Data Engineer Intro - WeCloudDataData Engineer Intro - WeCloudData
Data Engineer Intro - WeCloudData
WeCloudData
 
AWS Well Architected-Info Session WeCloudData
AWS Well Architected-Info Session WeCloudDataAWS Well Architected-Info Session WeCloudData
AWS Well Architected-Info Session WeCloudData
WeCloudData
 
Data Engineering Course Syllabus - WeCloudData
Data Engineering Course Syllabus - WeCloudDataData Engineering Course Syllabus - WeCloudData
Data Engineering Course Syllabus - WeCloudData
WeCloudData
 
Machine learning in Healthcare - WeCloudData
Machine learning in Healthcare - WeCloudDataMachine learning in Healthcare - WeCloudData
Machine learning in Healthcare - WeCloudData
WeCloudData
 
Big Data for Data Scientists - WeCloudData
Big Data for Data Scientists - WeCloudDataBig Data for Data Scientists - WeCloudData
Big Data for Data Scientists - WeCloudData
WeCloudData
 
Introduction to Python by WeCloudData
Introduction to Python by WeCloudDataIntroduction to Python by WeCloudData
Introduction to Python by WeCloudData
WeCloudData
 
Data Science Career Insights by WeCloudData
Data Science Career Insights by WeCloudDataData Science Career Insights by WeCloudData
Data Science Career Insights by WeCloudData
WeCloudData
 
Web scraping project aritza-compressed
Web scraping project   aritza-compressedWeb scraping project   aritza-compressed
Web scraping project aritza-compressed
WeCloudData
 
Applied Machine Learning Course - Jodie Zhu (WeCloudData)
Applied Machine Learning Course - Jodie Zhu (WeCloudData)Applied Machine Learning Course - Jodie Zhu (WeCloudData)
Applied Machine Learning Course - Jodie Zhu (WeCloudData)
WeCloudData
 
Introduction to Machine Learning - WeCloudData
Introduction to Machine Learning - WeCloudDataIntroduction to Machine Learning - WeCloudData
Introduction to Machine Learning - WeCloudData
WeCloudData
 
Big Data for Data Scientists - Info Session
Big Data for Data Scientists - Info SessionBig Data for Data Scientists - Info Session
Big Data for Data Scientists - Info Session
WeCloudData
 
WeCloudData Toronto Open311 Workshop - Matthew Reyes
WeCloudData Toronto Open311 Workshop - Matthew ReyesWeCloudData Toronto Open311 Workshop - Matthew Reyes
WeCloudData Toronto Open311 Workshop - Matthew Reyes
WeCloudData
 
Tordatasci meetup-precima-retail-analytics-201901
Tordatasci meetup-precima-retail-analytics-201901Tordatasci meetup-precima-retail-analytics-201901
Tordatasci meetup-precima-retail-analytics-201901
WeCloudData
 
Ad

Recently uploaded (20)

abebaw power point presentation esis october.ppt
abebaw power point presentation esis october.pptabebaw power point presentation esis october.ppt
abebaw power point presentation esis october.ppt
mihretwodage
 
lecture_13 tree in mmmmmmmm mmmmmfftro.pptx
lecture_13 tree in mmmmmmmm     mmmmmfftro.pptxlecture_13 tree in mmmmmmmm     mmmmmfftro.pptx
lecture_13 tree in mmmmmmmm mmmmmfftro.pptx
sarajafffri058
 
Mining a Global Trade Process with Data Science - Microsoft
Mining a Global Trade Process with Data Science - MicrosoftMining a Global Trade Process with Data Science - Microsoft
Mining a Global Trade Process with Data Science - Microsoft
Process mining Evangelist
 
MLOps_with_SageMaker_Template_EN idioma inglés
MLOps_with_SageMaker_Template_EN idioma inglésMLOps_with_SageMaker_Template_EN idioma inglés
MLOps_with_SageMaker_Template_EN idioma inglés
FabianPierrePeaJacob
 
Analysis of Billboards hot 100 toop five hit makers on the chart.docx
Analysis of Billboards hot 100 toop five hit makers on the chart.docxAnalysis of Billboards hot 100 toop five hit makers on the chart.docx
Analysis of Billboards hot 100 toop five hit makers on the chart.docx
hershtara1
 
How to Set Up Process Mining in a Decentralized Organization?
How to Set Up Process Mining in a Decentralized Organization?How to Set Up Process Mining in a Decentralized Organization?
How to Set Up Process Mining in a Decentralized Organization?
Process mining Evangelist
 
AI ------------------------------ W1L2.pptx
AI ------------------------------ W1L2.pptxAI ------------------------------ W1L2.pptx
AI ------------------------------ W1L2.pptx
AyeshaJalil6
 
Important JavaScript Concepts Every Developer Must Know
Important JavaScript Concepts Every Developer Must KnowImportant JavaScript Concepts Every Developer Must Know
Important JavaScript Concepts Every Developer Must Know
yashikanigam1
 
Process Mining Machine Recoveries to Reduce Downtime
Process Mining Machine Recoveries to Reduce DowntimeProcess Mining Machine Recoveries to Reduce Downtime
Process Mining Machine Recoveries to Reduce Downtime
Process mining Evangelist
 
hersh's midterm project.pdf music retail and distribution
hersh's midterm project.pdf music retail and distributionhersh's midterm project.pdf music retail and distribution
hersh's midterm project.pdf music retail and distribution
hershtara1
 
national income & related aggregates (1)(1).pptx
national income & related aggregates (1)(1).pptxnational income & related aggregates (1)(1).pptx
national income & related aggregates (1)(1).pptx
j2492618
 
TOAE201-Slides-Chapter 4. Sample theoretical basis (1).pdf
TOAE201-Slides-Chapter 4. Sample theoretical basis (1).pdfTOAE201-Slides-Chapter 4. Sample theoretical basis (1).pdf
TOAE201-Slides-Chapter 4. Sample theoretical basis (1).pdf
NhiV747372
 
Dynamics 365 Business Rules Dynamics Dynamics
Dynamics 365 Business Rules Dynamics DynamicsDynamics 365 Business Rules Dynamics Dynamics
Dynamics 365 Business Rules Dynamics Dynamics
heyoubro69
 
Introduction to Python_for_machine_learning.pdf
Introduction to Python_for_machine_learning.pdfIntroduction to Python_for_machine_learning.pdf
Introduction to Python_for_machine_learning.pdf
goldenflower34
 
Controlling Financial Processes at a Municipality
Controlling Financial Processes at a MunicipalityControlling Financial Processes at a Municipality
Controlling Financial Processes at a Municipality
Process mining Evangelist
 
Urban models for professional practice 03
Urban models for professional practice 03Urban models for professional practice 03
Urban models for professional practice 03
DanisseLoiDapdap
 
Database administration and management chapter 12
Database administration and management chapter 12Database administration and management chapter 12
Database administration and management chapter 12
saniaafzalf1f2f3
 
report (maam dona subject).pptxhsgwiswhs
report (maam dona subject).pptxhsgwiswhsreport (maam dona subject).pptxhsgwiswhs
report (maam dona subject).pptxhsgwiswhs
AngelPinedaTaguinod
 
Automated Melanoma Detection via Image Processing.pptx
Automated Melanoma Detection via Image Processing.pptxAutomated Melanoma Detection via Image Processing.pptx
Automated Melanoma Detection via Image Processing.pptx
handrymaharjan23
 
AWS-Certified-ML-Engineer-Associate-Slides.pdf
AWS-Certified-ML-Engineer-Associate-Slides.pdfAWS-Certified-ML-Engineer-Associate-Slides.pdf
AWS-Certified-ML-Engineer-Associate-Slides.pdf
philsparkshome
 
abebaw power point presentation esis october.ppt
abebaw power point presentation esis october.pptabebaw power point presentation esis october.ppt
abebaw power point presentation esis october.ppt
mihretwodage
 
lecture_13 tree in mmmmmmmm mmmmmfftro.pptx
lecture_13 tree in mmmmmmmm     mmmmmfftro.pptxlecture_13 tree in mmmmmmmm     mmmmmfftro.pptx
lecture_13 tree in mmmmmmmm mmmmmfftro.pptx
sarajafffri058
 
Mining a Global Trade Process with Data Science - Microsoft
Mining a Global Trade Process with Data Science - MicrosoftMining a Global Trade Process with Data Science - Microsoft
Mining a Global Trade Process with Data Science - Microsoft
Process mining Evangelist
 
MLOps_with_SageMaker_Template_EN idioma inglés
MLOps_with_SageMaker_Template_EN idioma inglésMLOps_with_SageMaker_Template_EN idioma inglés
MLOps_with_SageMaker_Template_EN idioma inglés
FabianPierrePeaJacob
 
Analysis of Billboards hot 100 toop five hit makers on the chart.docx
Analysis of Billboards hot 100 toop five hit makers on the chart.docxAnalysis of Billboards hot 100 toop five hit makers on the chart.docx
Analysis of Billboards hot 100 toop five hit makers on the chart.docx
hershtara1
 
How to Set Up Process Mining in a Decentralized Organization?
How to Set Up Process Mining in a Decentralized Organization?How to Set Up Process Mining in a Decentralized Organization?
How to Set Up Process Mining in a Decentralized Organization?
Process mining Evangelist
 
AI ------------------------------ W1L2.pptx
AI ------------------------------ W1L2.pptxAI ------------------------------ W1L2.pptx
AI ------------------------------ W1L2.pptx
AyeshaJalil6
 
Important JavaScript Concepts Every Developer Must Know
Important JavaScript Concepts Every Developer Must KnowImportant JavaScript Concepts Every Developer Must Know
Important JavaScript Concepts Every Developer Must Know
yashikanigam1
 
Process Mining Machine Recoveries to Reduce Downtime
Process Mining Machine Recoveries to Reduce DowntimeProcess Mining Machine Recoveries to Reduce Downtime
Process Mining Machine Recoveries to Reduce Downtime
Process mining Evangelist
 
hersh's midterm project.pdf music retail and distribution
hersh's midterm project.pdf music retail and distributionhersh's midterm project.pdf music retail and distribution
hersh's midterm project.pdf music retail and distribution
hershtara1
 
national income & related aggregates (1)(1).pptx
national income & related aggregates (1)(1).pptxnational income & related aggregates (1)(1).pptx
national income & related aggregates (1)(1).pptx
j2492618
 
TOAE201-Slides-Chapter 4. Sample theoretical basis (1).pdf
TOAE201-Slides-Chapter 4. Sample theoretical basis (1).pdfTOAE201-Slides-Chapter 4. Sample theoretical basis (1).pdf
TOAE201-Slides-Chapter 4. Sample theoretical basis (1).pdf
NhiV747372
 
Dynamics 365 Business Rules Dynamics Dynamics
Dynamics 365 Business Rules Dynamics DynamicsDynamics 365 Business Rules Dynamics Dynamics
Dynamics 365 Business Rules Dynamics Dynamics
heyoubro69
 
Introduction to Python_for_machine_learning.pdf
Introduction to Python_for_machine_learning.pdfIntroduction to Python_for_machine_learning.pdf
Introduction to Python_for_machine_learning.pdf
goldenflower34
 
Controlling Financial Processes at a Municipality
Controlling Financial Processes at a MunicipalityControlling Financial Processes at a Municipality
Controlling Financial Processes at a Municipality
Process mining Evangelist
 
Urban models for professional practice 03
Urban models for professional practice 03Urban models for professional practice 03
Urban models for professional practice 03
DanisseLoiDapdap
 
Database administration and management chapter 12
Database administration and management chapter 12Database administration and management chapter 12
Database administration and management chapter 12
saniaafzalf1f2f3
 
report (maam dona subject).pptxhsgwiswhs
report (maam dona subject).pptxhsgwiswhsreport (maam dona subject).pptxhsgwiswhs
report (maam dona subject).pptxhsgwiswhs
AngelPinedaTaguinod
 
Automated Melanoma Detection via Image Processing.pptx
Automated Melanoma Detection via Image Processing.pptxAutomated Melanoma Detection via Image Processing.pptx
Automated Melanoma Detection via Image Processing.pptx
handrymaharjan23
 
AWS-Certified-ML-Engineer-Associate-Slides.pdf
AWS-Certified-ML-Engineer-Associate-Slides.pdfAWS-Certified-ML-Engineer-Associate-Slides.pdf
AWS-Certified-ML-Engineer-Associate-Slides.pdf
philsparkshome
 

Deep Learning Introduction - WeCloudData

  • 1. 1 – ML/DL Basics WeCloudData
  • 2. Outline • Machine Learning Basics • Deep Learning History & Basics • Linear Algebra Basics: From Vector to Tensor • Linear Regression • Loss/Cost Function • Gradient Descent • Logistic Regression • Hands-on Lab • Setting up the Environment • Graphs and Sessions in Tensorflow • Creating a Simple Tensorflow Graph • Visualizing the Graph • Learning about Constants and Variables
  • 4. Taraneh (Tara) Khazaei • B.Sc. and M.Sc. in Computer Science • Ph.D. in Computer Science ■ Machine Learning ■ Natural Language Processing ■ Social Media Analytics
  • 5. Taraneh (Tara) Khazaei • Data Scientist/Data Engineer at TD Bank ■ Customer 360 ■ Predictive modeling on financial and social media data • Research Scientist ■ Text mining on call center data ■ Word and graph embedding in the retail context • Data Scientist/Cloud Architect ■ Clickstream mining ■ Speech/text mining of call center data
  • 7. Applied Deep Learning ● Lectures + Labs ● NLP and text ● Final project ● NIPS: Neural Information Processing Systems ● ICLR: International Conference on Learning Representations ● ICML: International Conference on Machine Learning ● ACL: Annual Meetings of the Association of Computational Linguistics ● EMNLP: Empirical Methods in Natural Language Processing
  • 9. Machine Learning (ML) Basics: “How do you define ML?”
  • 10. Machine Learning Basics • Machine Learning: • “A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E” [1] • The Task, T • The Performance measure, P • The Experience, E
  • 11. The Task, T • Classification: Predict survey results (e.g., satisfied/dissatisfied) after the calls • Regression: Sales prediction in stormy weather • Transcription: Speech Recognition and OCR • Machine translation: Translation from English to French • Structured output: Grammatical parsing of language • Anomaly detection: Credit card fraud detection • Synthesis and sampling: Generation of landscape texture for video games
  • 12. The Experience, E • Supervised Learning • Unsupervised Learning • Semi-supervised Learning • Reinforcement Learning
  • 13. The Experience, E • Supervised Learning • Unsupervised Learning • Semi-supervised Learning • Reinforcement Learning Credit Approval Age Gender Annual Salary Months in Residence Months in Job Current Debt Paid off Credit Client 1 23 M $30,000 36 12 $5,000 Yes Client 2 30 F $45,000 12 12 $1,000 Yes Client 3 19 M $15,000 3 1 $10,000 No Client 4 25 M $25,000 12 27 $15,000 ? Uses past data to predict future feature s label
  • 14. The Experience, E • Supervised Learning • Unsupervised Learning • Semi-supervised Learning • Reinforcement Learning Credit Approval Age Gender Annual Salary Months in Residence Months in Job Current Debt Client 1 23 M $30,000 36 12 $5,000 Client 2 30 F $45,000 12 12 $1,000 Client 3 19 M $15,000 3 1 $10,000 Client 4 25 M $25,000 12 27 $15,000 Finds patterns features
  • 15. The Performance Measure, P • Accuracy: proportion of examples for which the model produces the correct output • Error rate: the proportion of examples for which the model produces an incorrect output • Precision, recall, and F-score • Mean Square Error:
  • 16. The Performance Measure, P • Training/Test split • N-Fold Cross-Validation
  • 17. Deep Learning Basics and History
  • 19. Deep Learning Basics • Many of the ideas were developed in 80s and 90s, but DL started to take off ~2010, why? • Large amounts of training data • Faster machines (CPUs/GPUs) • New algorithms and ideas Speech Recognition Vision Text
  • 31. Linear Algebra Basics: From Vector To Tensor
  • 32. Linear Algebra Basics • Scalar: Just a single number • Vectors: A vector is an array of numbers arranged in order • Matrix: A matrix is a 2-D array of numbers, so each element is identified by two indices instead of just one
  • 33. Linear Algebra Basics • Tensors: In some cases we will need an array with more than two axes. In the general case, an array of numbers arranged on a regular grid with a variable number of axes is known as a tensor.
  • 36. Linear Regression Boston Housing Data Vector of input features: X ∈ Rn x(i) : ith row/house/vector x(i) j: jth parameter in the ith row Label: y y(i): label for the ith house
  • 40. So how do you choose ? How to choose ‘s ?
  • 41. Cost Function (Least Squares) Choose so that is close to for training examples
  • 42. Cost Function (Least Squares) Choose so that is close to for training examples Hypothesis: Parameters:
  • 43. Cost Function (Least Squares) Choose so that is close to for training examples Hypothesis: Parameters: Cost Function: Goal:
  • 46. Cost Function After exhaustively trying different values of we get a contour plot which captures the relationship between and the cost (error)
  • 47. Gradient Descent Takes a step into the steepest downhill direction
  • 48. Learning Rate If is too small, gradient descent can be very slow to converge Cost Cost If is too large, gradient descent can overshoot the minimum. It may even fail to converge, or even diverge
  • 49. Gradient Descent The idea of gradient descent is to find the best combination of parameters so that the cost function can be minimized
  • 50. Local Minimum Gradient descent can converge to a local minimum local minimum global minimum
  • 51. Batch Gradient Descent vs. Stochastic Gradient Descent Batch Gradient Descent Each step of gradient descent (epoch) uses all the training examples Takes more passes of the data to converge Slower to train Smaller dataset Offline learning Stochastic Gradient Descent Each step of gradient descent (epoch) uses only one training example Takes less passes of the data to converge Faster to train, but oscillate a lot Large dataset Online learning
  • 53. Multivariate Linear Regression For convenience, we can set
  • 54. Multivariate Linear Regression Repeat until convergence { } When n = 1 Repeat until convergence { } Multivariate Regression (n >> 1) …
  • 55. Gradient Descent in Practice • Feature Scaling (Mean Normalization) • Scale the features to normal ranges will make the algorithm converge faster • Tuning the learning rate • Tuning the learning rate also controls the convergence speed of the algorithm
  • 57. Logistic Regression – Cost Function • Predicts the probability of a particular data point to a class: • Supervised learning • Classification Sigmoid Function
  • 60. Tensorflow ● Google ● NVIDIA ● Intel ● SAP ● eBay ● Airbus ● Uber ● Airbnb ● Snap ● Dropbox
  • 61. Tensorflow ● Python API ● Portability: deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device with a single API ● Flexibility: from Raspberry Pi, Android, Windows, iOS, Linux to server farms ● Visualization via Tensorboard ● Save and restore models and computational graphs ● Large community (~300k commits, ~85k repositories) ● Awesome projects already using TensorFlow
  • 62. Azure - Data Science VM
  • 63. Azure - Data Science VM Alternative: Grab a Linux VM online, install Python, Tensorflow, and Jupyter and use the VM locally for free.
  • 64. Required Libraries ● Python (default): 3.5 ● Tensorflow (Tensorboard): 1.6.0 ● Jupyter: 5.4.1
  • 65. Required Libraries ● Python (default): 3.5 ● Tensorflow (Tensorboard): 1.6.0 ● Jupyter: 5.4.1 ssh -L 8888:localhost:8888 user@example.com
  • 66. Tensorflow Tensorflow separates definitions of computations from their execution: ● Define a graph of computations in Python ● Use a session to execute operations in the graph ● Tensorflow runs the graph using a optimized C++ code import tensorflow as tf a = tf.add(3, 5)
  • 67. Tensorflow Tensorflow separates definitions of computations from their execution: ● Define a graph of computations in Python ● Use a session to execute operations in the graph ● Tensorflow runs the graph using a optimized C++ code import tensorflow as tf a = tf.add(3, 5)
  • 68. Tensorflow Separates definitions of computations from their execution: ● Define a graph of computations in Python ● Use a session to execute operations in the graph ○ Create a session, assign it to a variable so we can call it later ○ Within the session, evaluate the graph to fetch the value of a import tensorflow as tf a = tf.add(3, 5) sess = tf.Session() print(sess.run(a)) sess.close()
  • 69. Tensorflow Separates definitions of computations from their execution: ● Define a graph of computations in Python ● Use a session to execute operations in the graph ○ Create a session, assign it to a variable so we can call it later ○ Within the session, evaluate the graph to fetch the value of a import tensorflow as tf a = tf.add(3, 5) with tf.Session() as sess: print(sess.run(a))
  • 70. Tensorflow x = 2 y = 3 op1 = tf.add(x, y) op2 = tf.multiply(x, y) op3 = tf.pow(op2, op1) with tf.Session() as sess: op3 = sess.run(op3)
  • 71. Tensorflow x = 2 y = 3 op1 = tf.add(x, y) op2 = tf.multiply(x, y) op3 = tf.pow(op2, op1) writer = tf.summary.FileWriter('./graphs', tf.get_default_graph()) with tf.Session() as sess: writer = tf.summary.FileWriter('./graphs', sess.graph) op3 = sess.run(op3) writer.close()
  • 72. Tensorflow x = 2 y = 3 op1 = tf.add(x, y) op2 = tf.multiply(x, y) op3 = tf.pow(op2, op1) writer = tf.summary.FileWriter('./graphs', tf.get_default_graph()) with tf.Session() as sess: #writer = tf.summary.FileWriter('./graphs', sess.graph) op3 = sess.run(op3) writer.close()
  • 73. Tensorflow x = tf.constant(2, name='a') y = tf.constant(3, name ='b') op1 = tf.add(x, y) op2 = tf.multiply(x, y) op3 = tf.pow(op2, op1) writer = tf.summary.FileWriter('./graphs', tf.get_default_graph()) with tf.Session() as sess: #writer = tf.summary.FileWriter('./graphs', sess.graph) op3 = sess.run(op3) writer.close() tf.constant( value, dtype=None, shape=None, name='Const', verify_shape=False )
  • 76. Tensorflow x = tf.constant(2, name='a') y = tf.constant(3, name ='b') op1 = tf.add(x, y, name='add') op2 = tf.multiply(x, y, name='multiply') op3 = tf.pow(op2, op1, name='power') writer = tf.summary.FileWriter('./graphs', tf.get_default_graph()) with tf.Session() as sess: #writer = tf.summary.FileWriter('./graphs', sess.graph) op3 = sess.run(op3) writer.close()
  • 77. Tensorflow tensorboard --logdir="./graphs" --port 6006 Port forwarding to your machine: ssh -L 6006:localhost:6006 user@example.com
  翻译: