SlideShare una empresa de Scribd logo
1 de 47
Descargar para leer sin conexión
Graph Gurus Episode 19
Deep Learning Implemented By GSQL
On A Native Parallel Graph Database
© 2019 TigerGraph. All Rights Reserved
Welcome
• Attendees are muted but you can talk to us via Chat in Zoom
• We will have 10 min for Q&A at the end 
• Send questions at any time using the Q&A tab in the Zoom menu
• The webinar will be recorded 
• A link to the presentation and reproducible steps will be emailed
Developer Edition Download -
https://www.tigergraph.com/developer/ 
TigerGraph Cloud -
https://www.tigergraph.com/cloud/ 
© 2019 TigerGraph. All Rights Reserved
Speaking Today
● BS in Mechanical Engineering, Tsinghua
University, China
● MS & PhD in Mechanical Engineering, Stanford
University focused on numerical simulations of
nanophysics
● PhD minor in Philosophy focused on applications
of mathematical logic in artificial intelligence
Changran Liu,
Solution Architect
Victor Lee,
Director of Product
Management
● BS in Electrical Engineering and Computer
Science from UC Berkeley, MS in Electrical
Engineering from Stanford University
● PhD in Computer Science from Kent State
University focused on graph data mining
● 15+ years in tech industry
© 2019 TigerGraph. All Rights Reserved
Outline
● Graphs and Machine Learning
● Deep Learning Basics
● GSQL Neural Network Demo:
recognizing handwritten digits
● GSQL Neural Network: closer look
• Prediction (forward propagation)
• Cost function
• Training (backpropagation)
• Recap
© 2019 TigerGraph. All Rights
Reserved
Two Hot Items: A Good Match?
5
Powerful way to represent
information and to query it
Graph Database Machine Learning
Established powerhouse for
predictions and "smart" systems,
but still tricky to use
© 2019 TigerGraph. All Rights
Reserved
Natural and organic approach for representing
all kinds of things, ideas, and how they relate to
one another.
6
Profile
Events
Locations
Blockchain, Network
Analysis
Browsing
History
Transactions
Recommendations
New Products
Predictions
Supply Chain
CyberSecurity
Purchases
Graph Is How WE THINK
Use the power of relationships and
deep analytics to provide insights
Identify key data and process
massive amounts of data
Profile
Events
Locations
Browsing
History
Transactions
Purchases
© 2019 TigerGraph. All Rights Reserved
Some Uses of Machine Learning
● Virtual Personal Assistants
○ Voice-to-text
○ Semantic analysis
○ Formulate a response
● Real-time route optimization
○ Waze, Google Maps
● Image Recognition
○ Facial recognition
○ X-ray / CT scan reading
● Effective spam filters
7
© 2019 TigerGraph. All Rights Reserved
Some Machine Learning Techniques
● Unsupervised Learning
No "correct" answer; detect patterns or summarize
○ Clustering, Partitioning, Outlier detection
○ Neural Networks
○ Dimensionality reduction
● Supervised Learning
Humans provide "training data" with known correct answers
○ Decision Trees
○ Nearest Neighbor
○ Hidden Markov Model,Naïve Bayesian
○ Linear Regression
○ Support Vector Machines (SVM)
○ Neural Networks, Deep Learning
8
© 2019 TigerGraph. All Rights Reserved
Graph Analytics - Explainable Results
9
● The data model itself is explanatory
● Graph Analytics = Connecting the Dots
© 2019 TigerGraph. All Rights Reserved
Three Ways to Use Graph for Machine Learning
● Use Graph Algorithms for Unsupervised Learning
○ Frequency Patterns
○ Community Detection
○ Ranking
● Extract Graph Features to use for Supervised Learning
○ Graph provides unique, richer features
○ Can work with many different ML techniques
○ Manual Feature Selection or Graph Embedding,
representing the entire graph as features of each vertices.
● Use the Graph as a Neural Network
10
© 2019 TigerGraph. All Rights Reserved
Neural Network
11
● Input layer:
input variables
● Output layer: the
result
● Hidden layer:
internal intermediate
variables
● Training process will
set the weights of
the connecting
edges.
https://www.pnas.org/content/116/4/1074 "What are the limits of deep learning?"
Neural Networks
ARE graphs!
Training can be
computationally intense:
● many edges
● each edge weight
may be recomputed
for each iteration.
⇒ Need Native Parallel
Graph for performance
© 2019 TigerGraph. All Rights Reserved
Neural Network & Deep Learning
12
Deep Learning is simply
using a Neural Network
with multiple hidden
layers.
● Layers may be
pre-trained to guide
their their behavior
https://www.pnas.org/content/116/4/1074 "What are the limits of deep learning?"
© 2019 TigerGraph. All Rights Reserved
Deep Learning Technologies
Facial recognition Real-time translation Strategy games: Go, Chess
© 2019 TigerGraph. All Rights Reserved
Outline
● Graphs and Machine Learning
● Deep Learning Basics
● GSQL Neural Network Demo:
recognizing handwritten digits
● GSQL Neural Network: closer look
• Prediction (forward propagation)
• Cost function
• Training (backpropagation)
• Recap
© 2019 TigerGraph. All Rights Reserved
Recognize Handwritten Digits
20 by 20 Grayscale Image Neural Network
1
2
3
4
5
6
7
8
9
0
© 2019 TigerGraph. All Rights Reserved
Problem Introduction
Examples of Training Dataset
• Goal: recognition of handwritten digits
• Data: each input is a 20 by 20 grayscale image
showing a handwritten digit (400 dimensional vector)
• 5000 images are split into two parts:
• Training: 4000 images
• Validation: 1000 images
 Training data from: https://www.coursera.org/learn/machine-learning
© 2019 TigerGraph. All Rights Reserved
Demo
● Graphs and Machine Learning
● Deep Learning Basics
● GSQL Neural Network Demo:
recognizing handwritten digits
● GSQL Neural Network: closer look
• Prediction (forward propagation)
• Cost function
• Training (backpropagation)
• Recap
© 2019 TigerGraph. All Rights Reserved
Schema
• Training/validation data (x, y) are stored on the inputLayer and outputLayer vertices
respectively.
• Randomly generated weight are initially stored on Theta1 and Theta2 edges
outputLayerhiddenLayerinputLayer
v_in_id STRING
x_training LIST<DOUBLE>
x_validation LIST<DOUBLE>
v_out_id STRING
y_training LIST<DOUBLE>
y_validation LIST<DOUBLE>
theta DOUBLE theta DOUBLE
v_hid_id STRING
Theta1 Theta2
© 2019 TigerGraph. All Rights Reserved
Graph
Input Layer Hidden Layer Output Layer
© 2019 TigerGraph. All Rights Reserved
10 vertices
representing 0 ~ 9
Theta1:
401 x 25 edges
Theta2:
26 x 10 edges
400 vertices
for 20 x 20 pixels
1 bias
25 vertices
1 bias
Graph
Input Layer Hidden Layer Output Layer
© 2019 TigerGraph. All Rights Reserved
Loading Data
Input Layer Hidden Layer
10 vertices
representing 0 ~ 9
Theta1:
401 x 25 edges
Theta2:
26 x 10 edges
400 vertices
for 20 x 20 pixels
1 bias
25 vertices
1 bias
Output Layer
© 2019 TigerGraph. All Rights Reserved
Loading Data
Input Layer Hidden Layer
10 vertices
representing 0 ~ 9400 vertices
for 20 x 20 pixels
1 bias
25 vertices
1 bias
Output Layer
Theta1:
401 x 25 edges
Theta2:
26 x 10 edges
© 2019 TigerGraph. All Rights Reserved
Loading Data
Input Layer Hidden Layer
10 vertices
representing 0 ~ 9
400 vertices
for 20 x 20 pixels
1 bias
25 vertices
1 bias
Output Layer
…
Theta1:
401 x 25 edges
Theta2:
26 x 10 edges
© 2019 TigerGraph. All Rights Reserved
Loading Data
Input Layer Hidden Layer
10 vertices
representing 0 ~ 9
400 vertices
for 20 x 20 pixels
1 bias
25 vertices
1 bias
Output Layer
x_training =
x_training =
4000 images
= y_training
= y_training
4000 images
Theta1:
401 x 25 edges
Theta2:
26 x 10 edges
© 2019 TigerGraph. All Rights Reserved
Loading Data
Input Layer Hidden Layer
10 vertices
representing 0 ~ 9
400 vertices
for 20 x 20 pixels
1 bias
25 vertices
1 bias
Output Layer
x_validation =
x_validation =
1000 images
= y_validation
= y_validation
1000 images
Theta1:
401 x 25 edges
Theta2:
26 x 10
edges
© 2019 TigerGraph. All Rights Reserved
Neuron A (biological) neuron
• receives signals
• processes the signals
• signals neurons connected to it.
Learning involves
• growing topic-specific
dendrites to connect specific
neurons at specific synapses.
An artificial neuron
• same as above
Learning involves
• adjusting the weights of the
network to improve the
accuracy of the result.
• This is done by minimizing the
observed errors.https://en.wikipedia.org/wiki/Artificial_neural_network#/media/File:Neuron3.png
© 2019 TigerGraph. All Rights Reserved
Training a Neural Network
input
forward propagation
diff. btw prediction and label
converged?
no
finish
yes
backpropagation
update weight
© 2019 TigerGraph. All Rights Reserved
Training a Neural Network
input
forward propagation
diff. btw prediction and label
converged?
no
finish
yes
backpropagation
update weight
© 2019 TigerGraph. All Rights Reserved
Forward Propagation
CREATE QUERY training() FOR GRAPH NeuralNetwork {
/* variables declaration */
…
/* forward propagation*/
InputLayer = {inputLayer.*};
InputLayer = SELECT s FROM InputLayer:s -(Theta1:e)->hiddenLayer:t
ACCUM
IF s.v_in_id == "401" THEN
t.@a_training += product_List_const(@@ones_training, e.theta)
ELSE
t.@a_training += product_List_const(s.x_training, e.theta)
END
POST-ACCUM
t.@a_training = sigmoid_ArrayAccum(t.@a_training);
1
© 2019 TigerGraph. All Rights Reserved
Forward Propagation
CREATE QUERY training() FOR GRAPH NeuralNetwork {
/* variables declaration */
…
/* forward propagation*/
InputLayer = {inputLayer.*};
InputLayer = SELECT s FROM InputLayer:s -(Theta1:e)->hiddenLayer:t
ACCUM
IF s.v_in_id == "401" THEN
t.@a_training += product_List_const(@@ones_training,
e.theta)
ELSE
t.@a_training += product_List_const(s.x_training, e.theta)
END
POST-ACCUM
t.@a_training = sigmoid_ArrayAccum(t.@a_training);
1
© 2019 TigerGraph. All Rights Reserved
Forward Propagation
CREATE QUERY training() FOR GRAPH NeuralNetwork {
/* variables declaration */
…
/* forward propagation*/
InputLayer = {inputLayer.*};
InputLayer = SELECT s FROM InputLayer:s -(Theta1:e)->hiddenLayer:t
ACCUM
IF s.v_in_id == "401" THEN
t.@a_training += product_List_const(@@ones_training, e.theta)
ELSE
t.@a_training += product_List_const(s.x_training, e.theta)
END
POST-ACCUM
t.@a_training = sigmoid_ArrayAccum(t.@a_training);
1
© 2019 TigerGraph. All Rights Reserved
Forward Propagation
HiddenLayer = {hiddenLayer.*};
HiddenLayer = SELECT s FROM HiddenLayer:s -(Theta2:e)->outputLayer:t
ACCUM
IF s.v_hid_id == "26" THEN
t.@a_training += product_List_const(@@ones_training, e.theta)
ELSE
t.@a_training += product_ArrayAccum_const(s.@a_training, e.theta)
END
POST-ACCUM
t.@a_training = sigmoid_ArrayAccum(t.@a_training);
1
© 2019 TigerGraph. All Rights Reserved
Forward Propagation
HiddenLayer = {hiddenLayer.*};
HiddenLayer = SELECT s FROM HiddenLayer:s -(Theta2:e)->outputLayer:t
ACCUM
IF s.v_hid_id == "26" THEN
t.@a_training += product_List_const(@@ones_training,
e.theta)
ELSE
t.@a_training += product_ArrayAccum_const(s.@a_training,
e.theta)
END
POST-ACCUM
t.@a_training = sigmoid_ArrayAccum(t.@a_training);
1
© 2019 TigerGraph. All Rights Reserved
Forward Propagation
HiddenLayer = {hiddenLayer.*};
HiddenLayer = SELECT s FROM HiddenLayer:s -(Theta2:e)->outputLayer:t
ACCUM
IF s.v_hid_id == "26" THEN
t.@a_training += product_List_const(@@ones_training,
e.theta)
ELSE
t.@a_training += product_ArrayAccum_const(s.@a_training,
e.theta)
END
POST-ACCUM
t.@a_training = sigmoid_ArrayAccum(t.@a_training);
1
© 2019 TigerGraph. All Rights Reserved
Training a Neural Network
input
forward propagation
diff. btw prediction and label
converged?
no
finish
yes
backpropagation
update weight
© 2019 TigerGraph. All Rights Reserved
Backpropagation
OutputLayer = SELECT s FROM OutputLayer:s
ACCUM
s.@delta += diff_ArrayAccum_List(s.@a_training, s.y_training),
OutputLayer = SELECT s FROM OutputLayer:s -(Theta2:e)->hiddenLayer:t
ACCUM
t.@delta += product_ArrayAccum_const(s.@delta, e.theta)
POST-ACCUM
t.@delta += delta_ArrayAccum(t.@delta, t.@a);
© 2019 TigerGraph. All Rights Reserved
Backpropagation
OutputLayer = SELECT s FROM OutputLayer:s
ACCUM
s.@delta += diff_ArrayAccum_List(s.@a_training, s.y_training);
OutputLayer = SELECT s FROM OutputLayer:s -(Theta2:e)->hiddenLayer:t
ACCUM
t.@delta += product_ArrayAccum_const(s.@delta, e.theta)
POST-ACCUM
t.@delta += delta_ArrayAccum(t.@delta, t.@a);
© 2019 TigerGraph. All Rights Reserved
Backpropagation
OutputLayer = SELECT s FROM OutputLayer:s
ACCUM
s.@delta += diff_ArrayAccum_List(s.@a_training, s.y_training);
OutputLayer = SELECT s FROM OutputLayer:s -(Theta2:e)->hiddenLayer:t
ACCUM
t.@delta += product_ArrayAccum_const(s.@delta, e.theta)
POST-ACCUM
t.@delta += delta_ArrayAccum(t.@delta, t.@a);
© 2019 TigerGraph. All Rights Reserved
Backpropagation
OutputLayer = SELECT s FROM OutputLayer:s
ACCUM
s.@delta += diff_ArrayAccum_List(s.@a_training, s.y_training),
OutputLayer = SELECT s FROM OutputLayer:s -(Theta2:e)->hiddenLayer:t
ACCUM
t.@delta += product_ArrayAccum_const(s.@delta, e.theta)
POST-ACCUM
t.@delta += delta_ArrayAccum(t.@delta, t.@a);
© 2019 TigerGraph. All Rights Reserved
Update Theta1
InputLayer = SELECT s FROM InputLayer:s -(Theta1:e)->hiddenLayer:t
ACCUM
DOUBLE D = 0,
IF s.v_in_id == "401" THEN
D = dotProduct_ArrayAccum_List(t.@delta, @@ones_training),
D = D/4000
ELSE
D = dotProduct_ArrayAccum_List(t.@delta , s.x_training),
D = D/4000+lambda*e.theta/4000
END,
e.theta = e.theta - alpha * D;
1
© 2019 TigerGraph. All Rights Reserved
Update Theta1
InputLayer = SELECT s FROM InputLayer:s -(Theta1:e)->hiddenLayer:t
ACCUM
DOUBLE D = 0,
IF s.v_in_id == "401" THEN
D = dotProduct_ArrayAccum_List(t.@delta, @@ones_training),
D = D/4000
ELSE
D = dotProduct_ArrayAccum_List(t.@delta , s.x_training),
D = D/4000+lambda*e.theta/4000
END,
e.theta = e.theta - alpha * D;
1
© 2019 TigerGraph. All Rights Reserved
Update Theta2
HiddenLayer = SELECT s FROM HiddenLayer:s -(Theta2:e)->outputLayer:t
ACCUM
DOUBLE D = 0,
IF s.v_hid_id == "26" THEN
D = dotProduct_ArrayAccum_List(t.@delta, @@ones_training),
D = D/4000
ELSE
D = dotProduct_ArrayAccum_ArrayAccum(t.@delta, s.@a),
D = D/4000+lambda*e.theta/4000
END,
e.theta = e.theta - alpha * D;
}
1
© 2019 TigerGraph. All Rights Reserved
Update Theta2
HiddenLayer = SELECT s FROM HiddenLayer:s -(Theta2:e)->outputLayer:t
ACCUM
DOUBLE D = 0,
D = dotProduct_ArrayAccum_ArrayAccum(s.@a , t.@delta),
IF s.v_hid_id == "26" THEN
D = D/4000
ELSE
D = D/4000+lambda*e.theta/4000
END,
e.theta = e.theta - alpha * D;
}
1
© 2019 TigerGraph. All Rights Reserved
Summary
• Applications of deep learning
• Demo: recognize handwritten digit
• Implementation using GSQL
• Prediction (forward propagation)
• Training (backpropagation)The human brain contains about 100 billion
neurons
Q & A
Please send your questions via the Q&A menu in Zoom
© 2019 TigerGraph. All Rights Reserved
Sign up: info.tigergraph.com/graph-gurus-20
© 2019 TigerGraph. All Rights Reserved
Additional Resources
Test Drive Online Demo
https://www.tigergraph.com/demo  
Download the Developer Edition
https://www.tigergraph.com/download/ 
Developer Portal
https://www.tigergraph.com/developers/ 
Guru Scripts
https://github.com/tigergraph/ecosys/tree/master/guru_scripts 
Join our Developer Forum
https://groups.google.com/a/opengsql.org/forum/#!forum/gsql-users
linkedin.com/company/TigerGraphfacebook.com/TigerGraphDB@TigerGraphDB youtube.com/tigergraph

Más contenido relacionado

La actualidad más candente

Corinna Cortes, Head of Research, Google, at MLconf NYC 2017
Corinna Cortes, Head of Research, Google, at MLconf NYC 2017Corinna Cortes, Head of Research, Google, at MLconf NYC 2017
Corinna Cortes, Head of Research, Google, at MLconf NYC 2017
MLconf
 

La actualidad más candente (19)

Graph Gurus Episode 26: Using Graph Algorithms for Advanced Analytics Part 1
Graph Gurus Episode 26: Using Graph Algorithms for Advanced Analytics Part 1Graph Gurus Episode 26: Using Graph Algorithms for Advanced Analytics Part 1
Graph Gurus Episode 26: Using Graph Algorithms for Advanced Analytics Part 1
 
Graph Databases and Machine Learning | November 2018
Graph Databases and Machine Learning | November 2018Graph Databases and Machine Learning | November 2018
Graph Databases and Machine Learning | November 2018
 
Graph Gurus Episode 5: Webinar PageRank
Graph Gurus Episode 5: Webinar PageRankGraph Gurus Episode 5: Webinar PageRank
Graph Gurus Episode 5: Webinar PageRank
 
Graph Gurus Episode 17: Seven Key Data Science Capabilities Powered by a Nati...
Graph Gurus Episode 17: Seven Key Data Science Capabilities Powered by a Nati...Graph Gurus Episode 17: Seven Key Data Science Capabilities Powered by a Nati...
Graph Gurus Episode 17: Seven Key Data Science Capabilities Powered by a Nati...
 
Graph Gurus Episode 27: Using Graph Algorithms for Advanced Analytics Part 2
Graph Gurus Episode 27: Using Graph Algorithms for Advanced Analytics Part 2Graph Gurus Episode 27: Using Graph Algorithms for Advanced Analytics Part 2
Graph Gurus Episode 27: Using Graph Algorithms for Advanced Analytics Part 2
 
Graph Gurus Episode 4: Detecting Fraud and Money Laudering in Real-Time Part 2
Graph Gurus Episode 4: Detecting Fraud and Money Laudering in Real-Time Part 2Graph Gurus Episode 4: Detecting Fraud and Money Laudering in Real-Time Part 2
Graph Gurus Episode 4: Detecting Fraud and Money Laudering in Real-Time Part 2
 
Graph Gurus Episode 31: GSQL Writing Best Practices Part 1
Graph Gurus Episode 31: GSQL Writing Best Practices Part 1Graph Gurus Episode 31: GSQL Writing Best Practices Part 1
Graph Gurus Episode 31: GSQL Writing Best Practices Part 1
 
Using Graph Algorithms For Advanced Analytics - Part 4 Similarity 30 graph al...
Using Graph Algorithms For Advanced Analytics - Part 4 Similarity 30 graph al...Using Graph Algorithms For Advanced Analytics - Part 4 Similarity 30 graph al...
Using Graph Algorithms For Advanced Analytics - Part 4 Similarity 30 graph al...
 
Using Graph Algorithms for Advanced Analytics - Part 2 Centrality
Using Graph Algorithms for Advanced Analytics - Part 2 CentralityUsing Graph Algorithms for Advanced Analytics - Part 2 Centrality
Using Graph Algorithms for Advanced Analytics - Part 2 Centrality
 
Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15
Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15
Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15
 
Training at AI Frontiers 2018 - LaiOffer Data Session: How Spark Speedup AI
Training at AI Frontiers 2018 - LaiOffer Data Session: How Spark Speedup AI Training at AI Frontiers 2018 - LaiOffer Data Session: How Spark Speedup AI
Training at AI Frontiers 2018 - LaiOffer Data Session: How Spark Speedup AI
 
Jay Yagnik at AI Frontiers : A History Lesson on AI
Jay Yagnik at AI Frontiers : A History Lesson on AIJay Yagnik at AI Frontiers : A History Lesson on AI
Jay Yagnik at AI Frontiers : A History Lesson on AI
 
Predictive Model and Record Description with Segmented Sensitivity Analysis (...
Predictive Model and Record Description with Segmented Sensitivity Analysis (...Predictive Model and Record Description with Segmented Sensitivity Analysis (...
Predictive Model and Record Description with Segmented Sensitivity Analysis (...
 
Deep Learning with MXNet
Deep Learning with MXNetDeep Learning with MXNet
Deep Learning with MXNet
 
Corinna Cortes, Head of Research, Google, at MLconf NYC 2017
Corinna Cortes, Head of Research, Google, at MLconf NYC 2017Corinna Cortes, Head of Research, Google, at MLconf NYC 2017
Corinna Cortes, Head of Research, Google, at MLconf NYC 2017
 
Deep ar presentation
Deep ar presentationDeep ar presentation
Deep ar presentation
 
Distributed deep learning_over_spark_20_nov_2014_ver_2.8
Distributed deep learning_over_spark_20_nov_2014_ver_2.8Distributed deep learning_over_spark_20_nov_2014_ver_2.8
Distributed deep learning_over_spark_20_nov_2014_ver_2.8
 
AWS Forcecast: DeepAR Predictor Time-series
AWS Forcecast: DeepAR Predictor Time-series AWS Forcecast: DeepAR Predictor Time-series
AWS Forcecast: DeepAR Predictor Time-series
 
Introduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-LearnIntroduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-Learn
 

Similar a Graph Gurus Episode 19: Deep Learning Implemented by GSQL on a Native Parallel Graph Database

The Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdfThe Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdf
Neo4j
 
RAPIDS cuGraph – Accelerating all your Graph needs
RAPIDS cuGraph – Accelerating all your Graph needsRAPIDS cuGraph – Accelerating all your Graph needs
RAPIDS cuGraph – Accelerating all your Graph needs
Connected Data World
 
Droidcon2013 triangles gangolells_imagination
Droidcon2013 triangles gangolells_imaginationDroidcon2013 triangles gangolells_imagination
Droidcon2013 triangles gangolells_imagination
Droidcon Berlin
 
Learn to Build an App to Find Similar Images using Deep Learning- Piotr Teterwak
Learn to Build an App to Find Similar Images using Deep Learning- Piotr TeterwakLearn to Build an App to Find Similar Images using Deep Learning- Piotr Teterwak
Learn to Build an App to Find Similar Images using Deep Learning- Piotr Teterwak
PyData
 
Real-Time Fraud Detection at Scale—Integrating Real-Time Deep-Link Graph Anal...
Real-Time Fraud Detection at Scale—Integrating Real-Time Deep-Link Graph Anal...Real-Time Fraud Detection at Scale—Integrating Real-Time Deep-Link Graph Anal...
Real-Time Fraud Detection at Scale—Integrating Real-Time Deep-Link Graph Anal...
Databricks
 

Similar a Graph Gurus Episode 19: Deep Learning Implemented by GSQL on a Native Parallel Graph Database (20)

GPT and Graph Data Science to power your Knowledge Graph
GPT and Graph Data Science to power your Knowledge GraphGPT and Graph Data Science to power your Knowledge Graph
GPT and Graph Data Science to power your Knowledge Graph
 
Graph Gurus Episode 32: Using Graph Algorithms for Advanced Analytics Part 5
Graph Gurus Episode 32: Using Graph Algorithms for Advanced Analytics Part 5Graph Gurus Episode 32: Using Graph Algorithms for Advanced Analytics Part 5
Graph Gurus Episode 32: Using Graph Algorithms for Advanced Analytics Part 5
 
Demystifying Graph Neural Networks
Demystifying Graph Neural NetworksDemystifying Graph Neural Networks
Demystifying Graph Neural Networks
 
Shift Remote: AI: Smarter AI with analytical graph databases - Victor Lee (Ti...
Shift Remote: AI: Smarter AI with analytical graph databases - Victor Lee (Ti...Shift Remote: AI: Smarter AI with analytical graph databases - Victor Lee (Ti...
Shift Remote: AI: Smarter AI with analytical graph databases - Victor Lee (Ti...
 
The Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdfThe Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdf
 
RAPIDS cuGraph – Accelerating all your Graph needs
RAPIDS cuGraph – Accelerating all your Graph needsRAPIDS cuGraph – Accelerating all your Graph needs
RAPIDS cuGraph – Accelerating all your Graph needs
 
Graph Gurus Episode 8: Location, Location, Location - Geospatial Analysis wit...
Graph Gurus Episode 8: Location, Location, Location - Geospatial Analysis wit...Graph Gurus Episode 8: Location, Location, Location - Geospatial Analysis wit...
Graph Gurus Episode 8: Location, Location, Location - Geospatial Analysis wit...
 
IRJET- Generating 3D Models Using 3D Generative Adversarial Network
IRJET- Generating 3D Models Using 3D Generative Adversarial NetworkIRJET- Generating 3D Models Using 3D Generative Adversarial Network
IRJET- Generating 3D Models Using 3D Generative Adversarial Network
 
Artificial intelligence in IoT-to-core network operations and management
Artificial intelligence in IoT-to-core network operations and managementArtificial intelligence in IoT-to-core network operations and management
Artificial intelligence in IoT-to-core network operations and management
 
How Graph Data Science can turbocharge your Knowledge Graph
How Graph Data Science can turbocharge your Knowledge GraphHow Graph Data Science can turbocharge your Knowledge Graph
How Graph Data Science can turbocharge your Knowledge Graph
 
"Separable Convolutions for Efficient Implementation of CNNs and Other Vision...
"Separable Convolutions for Efficient Implementation of CNNs and Other Vision..."Separable Convolutions for Efficient Implementation of CNNs and Other Vision...
"Separable Convolutions for Efficient Implementation of CNNs and Other Vision...
 
Droidcon2013 triangles gangolells_imagination
Droidcon2013 triangles gangolells_imaginationDroidcon2013 triangles gangolells_imagination
Droidcon2013 triangles gangolells_imagination
 
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
 
Learn to Build an App to Find Similar Images using Deep Learning- Piotr Teterwak
Learn to Build an App to Find Similar Images using Deep Learning- Piotr TeterwakLearn to Build an App to Find Similar Images using Deep Learning- Piotr Teterwak
Learn to Build an App to Find Similar Images using Deep Learning- Piotr Teterwak
 
Creating a Machine Learning Model on the Cloud
Creating a Machine Learning Model on the CloudCreating a Machine Learning Model on the Cloud
Creating a Machine Learning Model on the Cloud
 
Graph Gurus 15: Introducing TigerGraph 2.4
Graph Gurus 15: Introducing TigerGraph 2.4 Graph Gurus 15: Introducing TigerGraph 2.4
Graph Gurus 15: Introducing TigerGraph 2.4
 
PyTorch Python Tutorial | Deep Learning Using PyTorch | Image Classifier Usin...
PyTorch Python Tutorial | Deep Learning Using PyTorch | Image Classifier Usin...PyTorch Python Tutorial | Deep Learning Using PyTorch | Image Classifier Usin...
PyTorch Python Tutorial | Deep Learning Using PyTorch | Image Classifier Usin...
 
Accelerating algorithmic and hardware advancements for power efficient on-dev...
Accelerating algorithmic and hardware advancements for power efficient on-dev...Accelerating algorithmic and hardware advancements for power efficient on-dev...
Accelerating algorithmic and hardware advancements for power efficient on-dev...
 
Cisco Connect Toronto 2018 DNA assurance
Cisco Connect Toronto 2018  DNA assuranceCisco Connect Toronto 2018  DNA assurance
Cisco Connect Toronto 2018 DNA assurance
 
Real-Time Fraud Detection at Scale—Integrating Real-Time Deep-Link Graph Anal...
Real-Time Fraud Detection at Scale—Integrating Real-Time Deep-Link Graph Anal...Real-Time Fraud Detection at Scale—Integrating Real-Time Deep-Link Graph Anal...
Real-Time Fraud Detection at Scale—Integrating Real-Time Deep-Link Graph Anal...
 

Más de TigerGraph

Más de TigerGraph (20)

MAXIMIZING THE VALUE OF SCIENTIFIC INFORMATION TO ACCELERATE INNOVATION
MAXIMIZING THE VALUE OF SCIENTIFIC INFORMATION TO ACCELERATE INNOVATIONMAXIMIZING THE VALUE OF SCIENTIFIC INFORMATION TO ACCELERATE INNOVATION
MAXIMIZING THE VALUE OF SCIENTIFIC INFORMATION TO ACCELERATE INNOVATION
 
Better Together: How Graph database enables easy data integration with Spark ...
Better Together: How Graph database enables easy data integration with Spark ...Better Together: How Graph database enables easy data integration with Spark ...
Better Together: How Graph database enables easy data integration with Spark ...
 
Building an accurate understanding of consumers based on real-world signals
Building an accurate understanding of consumers based on real-world signalsBuilding an accurate understanding of consumers based on real-world signals
Building an accurate understanding of consumers based on real-world signals
 
Care Intervention Assistant - Omaha Clinical Data Information System
Care Intervention Assistant - Omaha Clinical Data Information SystemCare Intervention Assistant - Omaha Clinical Data Information System
Care Intervention Assistant - Omaha Clinical Data Information System
 
Correspondent Banking Networks
Correspondent Banking NetworksCorrespondent Banking Networks
Correspondent Banking Networks
 
Delivering Large Scale Real-time Graph Analytics with Dell Infrastructure and...
Delivering Large Scale Real-time Graph Analytics with Dell Infrastructure and...Delivering Large Scale Real-time Graph Analytics with Dell Infrastructure and...
Delivering Large Scale Real-time Graph Analytics with Dell Infrastructure and...
 
Deploying an End-to-End TigerGraph Enterprise Architecture using Kafka, Maria...
Deploying an End-to-End TigerGraph Enterprise Architecture using Kafka, Maria...Deploying an End-to-End TigerGraph Enterprise Architecture using Kafka, Maria...
Deploying an End-to-End TigerGraph Enterprise Architecture using Kafka, Maria...
 
Fraud Detection and Compliance with Graph Learning
Fraud Detection and Compliance with Graph LearningFraud Detection and Compliance with Graph Learning
Fraud Detection and Compliance with Graph Learning
 
Fraudulent credit card cash-out detection On Graphs
Fraudulent credit card cash-out detection On GraphsFraudulent credit card cash-out detection On Graphs
Fraudulent credit card cash-out detection On Graphs
 
FROM DATAFRAMES TO GRAPH Data Science with pyTigerGraph
FROM DATAFRAMES TO GRAPH Data Science with pyTigerGraphFROM DATAFRAMES TO GRAPH Data Science with pyTigerGraph
FROM DATAFRAMES TO GRAPH Data Science with pyTigerGraph
 
Customer Experience Management
Customer Experience ManagementCustomer Experience Management
Customer Experience Management
 
Graph+AI for Fin. Services
Graph+AI for Fin. ServicesGraph+AI for Fin. Services
Graph+AI for Fin. Services
 
Davraz - A graph visualization and exploration software.
Davraz - A graph visualization and exploration software.Davraz - A graph visualization and exploration software.
Davraz - A graph visualization and exploration software.
 
Plume - A Code Property Graph Extraction and Analysis Library
Plume - A Code Property Graph Extraction and Analysis LibraryPlume - A Code Property Graph Extraction and Analysis Library
Plume - A Code Property Graph Extraction and Analysis Library
 
TigerGraph.js
TigerGraph.jsTigerGraph.js
TigerGraph.js
 
GRAPHS FOR THE FUTURE ENERGY SYSTEMS
GRAPHS FOR THE FUTURE ENERGY SYSTEMSGRAPHS FOR THE FUTURE ENERGY SYSTEMS
GRAPHS FOR THE FUTURE ENERGY SYSTEMS
 
Hardware Accelerated Machine Learning Solution for Detecting Fraud and Money ...
Hardware Accelerated Machine Learning Solution for Detecting Fraud and Money ...Hardware Accelerated Machine Learning Solution for Detecting Fraud and Money ...
Hardware Accelerated Machine Learning Solution for Detecting Fraud and Money ...
 
How to Build An AI Based Customer Data Platform: Learn the design patterns fo...
How to Build An AI Based Customer Data Platform: Learn the design patterns fo...How to Build An AI Based Customer Data Platform: Learn the design patterns fo...
How to Build An AI Based Customer Data Platform: Learn the design patterns fo...
 
Machine Learning Feature Design with TigerGraph 3.0 No-Code GUI
Machine Learning Feature Design with TigerGraph 3.0 No-Code GUIMachine Learning Feature Design with TigerGraph 3.0 No-Code GUI
Machine Learning Feature Design with TigerGraph 3.0 No-Code GUI
 
Recommendation Engine with In-Database Machine Learning
Recommendation Engine with In-Database Machine LearningRecommendation Engine with In-Database Machine Learning
Recommendation Engine with In-Database Machine Learning
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Último (20)

%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

Graph Gurus Episode 19: Deep Learning Implemented by GSQL on a Native Parallel Graph Database

  • 1. Graph Gurus Episode 19 Deep Learning Implemented By GSQL On A Native Parallel Graph Database
  • 2. © 2019 TigerGraph. All Rights Reserved Welcome • Attendees are muted but you can talk to us via Chat in Zoom • We will have 10 min for Q&A at the end  • Send questions at any time using the Q&A tab in the Zoom menu • The webinar will be recorded  • A link to the presentation and reproducible steps will be emailed Developer Edition Download - https://www.tigergraph.com/developer/  TigerGraph Cloud - https://www.tigergraph.com/cloud/ 
  • 3. © 2019 TigerGraph. All Rights Reserved Speaking Today ● BS in Mechanical Engineering, Tsinghua University, China ● MS & PhD in Mechanical Engineering, Stanford University focused on numerical simulations of nanophysics ● PhD minor in Philosophy focused on applications of mathematical logic in artificial intelligence Changran Liu, Solution Architect Victor Lee, Director of Product Management ● BS in Electrical Engineering and Computer Science from UC Berkeley, MS in Electrical Engineering from Stanford University ● PhD in Computer Science from Kent State University focused on graph data mining ● 15+ years in tech industry
  • 4. © 2019 TigerGraph. All Rights Reserved Outline ● Graphs and Machine Learning ● Deep Learning Basics ● GSQL Neural Network Demo: recognizing handwritten digits ● GSQL Neural Network: closer look • Prediction (forward propagation) • Cost function • Training (backpropagation) • Recap
  • 5. © 2019 TigerGraph. All Rights Reserved Two Hot Items: A Good Match? 5 Powerful way to represent information and to query it Graph Database Machine Learning Established powerhouse for predictions and "smart" systems, but still tricky to use
  • 6. © 2019 TigerGraph. All Rights Reserved Natural and organic approach for representing all kinds of things, ideas, and how they relate to one another. 6 Profile Events Locations Blockchain, Network Analysis Browsing History Transactions Recommendations New Products Predictions Supply Chain CyberSecurity Purchases Graph Is How WE THINK Use the power of relationships and deep analytics to provide insights Identify key data and process massive amounts of data Profile Events Locations Browsing History Transactions Purchases
  • 7. © 2019 TigerGraph. All Rights Reserved Some Uses of Machine Learning ● Virtual Personal Assistants ○ Voice-to-text ○ Semantic analysis ○ Formulate a response ● Real-time route optimization ○ Waze, Google Maps ● Image Recognition ○ Facial recognition ○ X-ray / CT scan reading ● Effective spam filters 7
  • 8. © 2019 TigerGraph. All Rights Reserved Some Machine Learning Techniques ● Unsupervised Learning No "correct" answer; detect patterns or summarize ○ Clustering, Partitioning, Outlier detection ○ Neural Networks ○ Dimensionality reduction ● Supervised Learning Humans provide "training data" with known correct answers ○ Decision Trees ○ Nearest Neighbor ○ Hidden Markov Model,Naïve Bayesian ○ Linear Regression ○ Support Vector Machines (SVM) ○ Neural Networks, Deep Learning 8
  • 9. © 2019 TigerGraph. All Rights Reserved Graph Analytics - Explainable Results 9 ● The data model itself is explanatory ● Graph Analytics = Connecting the Dots
  • 10. © 2019 TigerGraph. All Rights Reserved Three Ways to Use Graph for Machine Learning ● Use Graph Algorithms for Unsupervised Learning ○ Frequency Patterns ○ Community Detection ○ Ranking ● Extract Graph Features to use for Supervised Learning ○ Graph provides unique, richer features ○ Can work with many different ML techniques ○ Manual Feature Selection or Graph Embedding, representing the entire graph as features of each vertices. ● Use the Graph as a Neural Network 10
  • 11. © 2019 TigerGraph. All Rights Reserved Neural Network 11 ● Input layer: input variables ● Output layer: the result ● Hidden layer: internal intermediate variables ● Training process will set the weights of the connecting edges. https://www.pnas.org/content/116/4/1074 "What are the limits of deep learning?" Neural Networks ARE graphs! Training can be computationally intense: ● many edges ● each edge weight may be recomputed for each iteration. ⇒ Need Native Parallel Graph for performance
  • 12. © 2019 TigerGraph. All Rights Reserved Neural Network & Deep Learning 12 Deep Learning is simply using a Neural Network with multiple hidden layers. ● Layers may be pre-trained to guide their their behavior https://www.pnas.org/content/116/4/1074 "What are the limits of deep learning?"
  • 13. © 2019 TigerGraph. All Rights Reserved Deep Learning Technologies Facial recognition Real-time translation Strategy games: Go, Chess
  • 14. © 2019 TigerGraph. All Rights Reserved Outline ● Graphs and Machine Learning ● Deep Learning Basics ● GSQL Neural Network Demo: recognizing handwritten digits ● GSQL Neural Network: closer look • Prediction (forward propagation) • Cost function • Training (backpropagation) • Recap
  • 15. © 2019 TigerGraph. All Rights Reserved Recognize Handwritten Digits 20 by 20 Grayscale Image Neural Network 1 2 3 4 5 6 7 8 9 0
  • 16. © 2019 TigerGraph. All Rights Reserved Problem Introduction Examples of Training Dataset • Goal: recognition of handwritten digits • Data: each input is a 20 by 20 grayscale image showing a handwritten digit (400 dimensional vector) • 5000 images are split into two parts: • Training: 4000 images • Validation: 1000 images  Training data from: https://www.coursera.org/learn/machine-learning
  • 17. © 2019 TigerGraph. All Rights Reserved Demo ● Graphs and Machine Learning ● Deep Learning Basics ● GSQL Neural Network Demo: recognizing handwritten digits ● GSQL Neural Network: closer look • Prediction (forward propagation) • Cost function • Training (backpropagation) • Recap
  • 18. © 2019 TigerGraph. All Rights Reserved Schema • Training/validation data (x, y) are stored on the inputLayer and outputLayer vertices respectively. • Randomly generated weight are initially stored on Theta1 and Theta2 edges outputLayerhiddenLayerinputLayer v_in_id STRING x_training LIST<DOUBLE> x_validation LIST<DOUBLE> v_out_id STRING y_training LIST<DOUBLE> y_validation LIST<DOUBLE> theta DOUBLE theta DOUBLE v_hid_id STRING Theta1 Theta2
  • 19. © 2019 TigerGraph. All Rights Reserved Graph Input Layer Hidden Layer Output Layer
  • 20. © 2019 TigerGraph. All Rights Reserved 10 vertices representing 0 ~ 9 Theta1: 401 x 25 edges Theta2: 26 x 10 edges 400 vertices for 20 x 20 pixels 1 bias 25 vertices 1 bias Graph Input Layer Hidden Layer Output Layer
  • 21. © 2019 TigerGraph. All Rights Reserved Loading Data Input Layer Hidden Layer 10 vertices representing 0 ~ 9 Theta1: 401 x 25 edges Theta2: 26 x 10 edges 400 vertices for 20 x 20 pixels 1 bias 25 vertices 1 bias Output Layer
  • 22. © 2019 TigerGraph. All Rights Reserved Loading Data Input Layer Hidden Layer 10 vertices representing 0 ~ 9400 vertices for 20 x 20 pixels 1 bias 25 vertices 1 bias Output Layer Theta1: 401 x 25 edges Theta2: 26 x 10 edges
  • 23. © 2019 TigerGraph. All Rights Reserved Loading Data Input Layer Hidden Layer 10 vertices representing 0 ~ 9 400 vertices for 20 x 20 pixels 1 bias 25 vertices 1 bias Output Layer … Theta1: 401 x 25 edges Theta2: 26 x 10 edges
  • 24. © 2019 TigerGraph. All Rights Reserved Loading Data Input Layer Hidden Layer 10 vertices representing 0 ~ 9 400 vertices for 20 x 20 pixels 1 bias 25 vertices 1 bias Output Layer x_training = x_training = 4000 images = y_training = y_training 4000 images Theta1: 401 x 25 edges Theta2: 26 x 10 edges
  • 25. © 2019 TigerGraph. All Rights Reserved Loading Data Input Layer Hidden Layer 10 vertices representing 0 ~ 9 400 vertices for 20 x 20 pixels 1 bias 25 vertices 1 bias Output Layer x_validation = x_validation = 1000 images = y_validation = y_validation 1000 images Theta1: 401 x 25 edges Theta2: 26 x 10 edges
  • 26. © 2019 TigerGraph. All Rights Reserved Neuron A (biological) neuron • receives signals • processes the signals • signals neurons connected to it. Learning involves • growing topic-specific dendrites to connect specific neurons at specific synapses. An artificial neuron • same as above Learning involves • adjusting the weights of the network to improve the accuracy of the result. • This is done by minimizing the observed errors.https://en.wikipedia.org/wiki/Artificial_neural_network#/media/File:Neuron3.png
  • 27. © 2019 TigerGraph. All Rights Reserved Training a Neural Network input forward propagation diff. btw prediction and label converged? no finish yes backpropagation update weight
  • 28. © 2019 TigerGraph. All Rights Reserved Training a Neural Network input forward propagation diff. btw prediction and label converged? no finish yes backpropagation update weight
  • 29. © 2019 TigerGraph. All Rights Reserved Forward Propagation CREATE QUERY training() FOR GRAPH NeuralNetwork { /* variables declaration */ … /* forward propagation*/ InputLayer = {inputLayer.*}; InputLayer = SELECT s FROM InputLayer:s -(Theta1:e)->hiddenLayer:t ACCUM IF s.v_in_id == "401" THEN t.@a_training += product_List_const(@@ones_training, e.theta) ELSE t.@a_training += product_List_const(s.x_training, e.theta) END POST-ACCUM t.@a_training = sigmoid_ArrayAccum(t.@a_training); 1
  • 30. © 2019 TigerGraph. All Rights Reserved Forward Propagation CREATE QUERY training() FOR GRAPH NeuralNetwork { /* variables declaration */ … /* forward propagation*/ InputLayer = {inputLayer.*}; InputLayer = SELECT s FROM InputLayer:s -(Theta1:e)->hiddenLayer:t ACCUM IF s.v_in_id == "401" THEN t.@a_training += product_List_const(@@ones_training, e.theta) ELSE t.@a_training += product_List_const(s.x_training, e.theta) END POST-ACCUM t.@a_training = sigmoid_ArrayAccum(t.@a_training); 1
  • 31. © 2019 TigerGraph. All Rights Reserved Forward Propagation CREATE QUERY training() FOR GRAPH NeuralNetwork { /* variables declaration */ … /* forward propagation*/ InputLayer = {inputLayer.*}; InputLayer = SELECT s FROM InputLayer:s -(Theta1:e)->hiddenLayer:t ACCUM IF s.v_in_id == "401" THEN t.@a_training += product_List_const(@@ones_training, e.theta) ELSE t.@a_training += product_List_const(s.x_training, e.theta) END POST-ACCUM t.@a_training = sigmoid_ArrayAccum(t.@a_training); 1
  • 32. © 2019 TigerGraph. All Rights Reserved Forward Propagation HiddenLayer = {hiddenLayer.*}; HiddenLayer = SELECT s FROM HiddenLayer:s -(Theta2:e)->outputLayer:t ACCUM IF s.v_hid_id == "26" THEN t.@a_training += product_List_const(@@ones_training, e.theta) ELSE t.@a_training += product_ArrayAccum_const(s.@a_training, e.theta) END POST-ACCUM t.@a_training = sigmoid_ArrayAccum(t.@a_training); 1
  • 33. © 2019 TigerGraph. All Rights Reserved Forward Propagation HiddenLayer = {hiddenLayer.*}; HiddenLayer = SELECT s FROM HiddenLayer:s -(Theta2:e)->outputLayer:t ACCUM IF s.v_hid_id == "26" THEN t.@a_training += product_List_const(@@ones_training, e.theta) ELSE t.@a_training += product_ArrayAccum_const(s.@a_training, e.theta) END POST-ACCUM t.@a_training = sigmoid_ArrayAccum(t.@a_training); 1
  • 34. © 2019 TigerGraph. All Rights Reserved Forward Propagation HiddenLayer = {hiddenLayer.*}; HiddenLayer = SELECT s FROM HiddenLayer:s -(Theta2:e)->outputLayer:t ACCUM IF s.v_hid_id == "26" THEN t.@a_training += product_List_const(@@ones_training, e.theta) ELSE t.@a_training += product_ArrayAccum_const(s.@a_training, e.theta) END POST-ACCUM t.@a_training = sigmoid_ArrayAccum(t.@a_training); 1
  • 35. © 2019 TigerGraph. All Rights Reserved Training a Neural Network input forward propagation diff. btw prediction and label converged? no finish yes backpropagation update weight
  • 36. © 2019 TigerGraph. All Rights Reserved Backpropagation OutputLayer = SELECT s FROM OutputLayer:s ACCUM s.@delta += diff_ArrayAccum_List(s.@a_training, s.y_training), OutputLayer = SELECT s FROM OutputLayer:s -(Theta2:e)->hiddenLayer:t ACCUM t.@delta += product_ArrayAccum_const(s.@delta, e.theta) POST-ACCUM t.@delta += delta_ArrayAccum(t.@delta, t.@a);
  • 37. © 2019 TigerGraph. All Rights Reserved Backpropagation OutputLayer = SELECT s FROM OutputLayer:s ACCUM s.@delta += diff_ArrayAccum_List(s.@a_training, s.y_training); OutputLayer = SELECT s FROM OutputLayer:s -(Theta2:e)->hiddenLayer:t ACCUM t.@delta += product_ArrayAccum_const(s.@delta, e.theta) POST-ACCUM t.@delta += delta_ArrayAccum(t.@delta, t.@a);
  • 38. © 2019 TigerGraph. All Rights Reserved Backpropagation OutputLayer = SELECT s FROM OutputLayer:s ACCUM s.@delta += diff_ArrayAccum_List(s.@a_training, s.y_training); OutputLayer = SELECT s FROM OutputLayer:s -(Theta2:e)->hiddenLayer:t ACCUM t.@delta += product_ArrayAccum_const(s.@delta, e.theta) POST-ACCUM t.@delta += delta_ArrayAccum(t.@delta, t.@a);
  • 39. © 2019 TigerGraph. All Rights Reserved Backpropagation OutputLayer = SELECT s FROM OutputLayer:s ACCUM s.@delta += diff_ArrayAccum_List(s.@a_training, s.y_training), OutputLayer = SELECT s FROM OutputLayer:s -(Theta2:e)->hiddenLayer:t ACCUM t.@delta += product_ArrayAccum_const(s.@delta, e.theta) POST-ACCUM t.@delta += delta_ArrayAccum(t.@delta, t.@a);
  • 40. © 2019 TigerGraph. All Rights Reserved Update Theta1 InputLayer = SELECT s FROM InputLayer:s -(Theta1:e)->hiddenLayer:t ACCUM DOUBLE D = 0, IF s.v_in_id == "401" THEN D = dotProduct_ArrayAccum_List(t.@delta, @@ones_training), D = D/4000 ELSE D = dotProduct_ArrayAccum_List(t.@delta , s.x_training), D = D/4000+lambda*e.theta/4000 END, e.theta = e.theta - alpha * D; 1
  • 41. © 2019 TigerGraph. All Rights Reserved Update Theta1 InputLayer = SELECT s FROM InputLayer:s -(Theta1:e)->hiddenLayer:t ACCUM DOUBLE D = 0, IF s.v_in_id == "401" THEN D = dotProduct_ArrayAccum_List(t.@delta, @@ones_training), D = D/4000 ELSE D = dotProduct_ArrayAccum_List(t.@delta , s.x_training), D = D/4000+lambda*e.theta/4000 END, e.theta = e.theta - alpha * D; 1
  • 42. © 2019 TigerGraph. All Rights Reserved Update Theta2 HiddenLayer = SELECT s FROM HiddenLayer:s -(Theta2:e)->outputLayer:t ACCUM DOUBLE D = 0, IF s.v_hid_id == "26" THEN D = dotProduct_ArrayAccum_List(t.@delta, @@ones_training), D = D/4000 ELSE D = dotProduct_ArrayAccum_ArrayAccum(t.@delta, s.@a), D = D/4000+lambda*e.theta/4000 END, e.theta = e.theta - alpha * D; } 1
  • 43. © 2019 TigerGraph. All Rights Reserved Update Theta2 HiddenLayer = SELECT s FROM HiddenLayer:s -(Theta2:e)->outputLayer:t ACCUM DOUBLE D = 0, D = dotProduct_ArrayAccum_ArrayAccum(s.@a , t.@delta), IF s.v_hid_id == "26" THEN D = D/4000 ELSE D = D/4000+lambda*e.theta/4000 END, e.theta = e.theta - alpha * D; } 1
  • 44. © 2019 TigerGraph. All Rights Reserved Summary • Applications of deep learning • Demo: recognize handwritten digit • Implementation using GSQL • Prediction (forward propagation) • Training (backpropagation)The human brain contains about 100 billion neurons
  • 45. Q & A Please send your questions via the Q&A menu in Zoom
  • 46. © 2019 TigerGraph. All Rights Reserved Sign up: info.tigergraph.com/graph-gurus-20
  • 47. © 2019 TigerGraph. All Rights Reserved Additional Resources Test Drive Online Demo https://www.tigergraph.com/demo   Download the Developer Edition https://www.tigergraph.com/download/  Developer Portal https://www.tigergraph.com/developers/  Guru Scripts https://github.com/tigergraph/ecosys/tree/master/guru_scripts  Join our Developer Forum https://groups.google.com/a/opengsql.org/forum/#!forum/gsql-users linkedin.com/company/TigerGraphfacebook.com/TigerGraphDB@TigerGraphDB youtube.com/tigergraph