SlideShare a Scribd company logo
1 of 39
Download to read offline
A Tale of Three Deep
Learning Frameworks:
TensorFlow, Keras, and
PyTorch
Brooke Wenig
Jules S. Damji
Spark + AI Summit, London 4October 2018
About Us . . .
Machine LearningPractice Lead @ Databricks
Data Science @ Splunk & MyFitnessPal
MS Machine Learning(UCLA)
Fluentin Chinese
https://www.linkedin.com/in/brookewenig/
Brooke WenigJules S. Damji
Apache Spark Developer& Community
Advocate @Databricks
Program Chair Spark + AI Summit
Software engineering @Sun Microsystems,
Netscape, @Home, VeriSign, Scalix, Centrify,
LoudCloud/Opsware, ProQuest
https://www.linkedin.com/in/dmatrix
@2twitme
Agenda for Today’s Talk
• What’s Deep Learning and Why?
• Short Survey of 3 DL Frameworks
• TensorFlow
• Keras
• PyTorch
• Training Options
• Single Node
• Distributed
• Q&A
What is Deep Learning?
“Composing representations of data in a
hierarchical manner”
Why Deep Learning?
Applications
Source : MIT
Zoo of DL Frameworks: Which One?
DPL
Survey of Three Deep
Learning Frameworks
What’s TensorFlow?
• Open source from Google, 2015
• Current v1.12 API
• 2.0 Coming Soon... :)
• Declarative Toolkit
• Fast: Backend C/C++
• Data flow graphs
• Nodes are functions/operators
• Edges are input or data (tensors)
• Lazy execution
• Eager execution (1.7)
TensorFlow Key API Concepts
• Constants
• Variables
• Placeholders
• Operations
• Sessions
• Tensors
• Graphs
•
x = tf.constants (42, name= ‘x’)
w = tf.Variable(1.34,name=’w’)
input= tf.Placeholder(“float”)
c = tf.add(x, w); m = tf.matmul(a, b) ...
with tf.Session([URI]) as sess:
1, [1, 2], [[2, 3], [4, 5]] ...
g = tf.Graph(“my_graph”)
withg.as_default():
c = tf.add(x,w)
m= tf.matmul(a, b)
TensorFlow Code
import tensorflow as tf
a = tf.placeholder(tf.float32, shape=(2,1))
b = tf.placeholder(tf.float32, shape=(1,2))
c = tf.matmul(a, b)
sess = tf.Session()
print(sess.run(c, {a: [[1],[2]], b:[[3,4]]}))
[[3. 4.] [6. 8.]]
Create a TF Session
Run the session, with input parameters
for place holders ‘a’ & ’b’
‘c’ as an operation won’t to run until
sess.run() Lazily evaluated.
TF matmul matrix operation
TF session output
Create TF placeholder types, a & b
Define their input shape as tensors
TensorFlow Code: MNIST
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
# Create the model
x = tf.placeholder(tf.float32, [None, 784])
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf.zeros([10]))
y = tf.matmul(x, W) + b
y_ = tf.placeholder(tf.int64, [None])
...
# Define loss and optimizer
cross_entropy = tf.losses.sparse_softmax_cross_entropy(labels=y_, logits=y)
train_step = tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy)
#create session, train, and evaluate
sess = tf.InteractiveSession()
tf.global_variables_initializer().run()
# Train
for _ in range(1000):
batch_xs, batch_ys = mnist.train.next_batch(100)
sess.run(train_step, feed_dict={x: batch_xs, y_: batch_ys})
# Test trained model
correct_prediction = tf.equal(tf.argmax(y, 1), y_)
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
...
print(sess.run(accuracy, feed_dict={
x: mnist.test.images,
y_: mnist.test.labels
}))
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/mnist_softmax.py
Use tf input_data modules for MNIST
TF placeholders & variables
Define our model
TF variable for predicted value y’
Define our loss function: cross_entropy
Use Gradient Descent Optimizer
Train or evaluate the model
TensorFlow Programming Stack
CPU GPU Android iOS …TPU
Use canned estimators
Build models
Keras	
Models
Why TensorFlow: Community
AF
AF
• 105K+ stars!
• 11+M downloads
• Popular open-source code
• TensorFlow Hub & Blog
○ Code Examples &
Tutorials!
○ Learn + share from
others
Why TensorFlow: Tools
AF
AF
Deploy + Serve Models
TFX
Visualize Tensors flow
TensorFlow: We Get it … So What?
• Steep learning curve, but powerful!!
• Low-level APIs, butoffers control!!
• Expert in Machine Learning, justlearn!!
• Yet, high-level Estimators help, you bet!!
• Yeah, TensorFlow 2.0, ease-of-use,eagerexecution!
• Better, Keras integration helps, indeed!!
What’s Keras?
• Open source Python Library APIs for Deep Learning
• Current v2.2.2 APIs François Chollet (Google)
• APIs : with TensorFlow, CNTK and Theano Backends
• Easy to UseHigh-Level DeclarativeAPIs!
• Build layers
– Great for Neural Network Applications
– CNN
– RNN & LSTM
• Fast Experimentation,Modular & Extensible!
Keras Programming Stack
CPU GPU Android iOS …TPU
Use canned estimators
Specific
Runtime
Backend Impl
models
Python	Keras	API	
TF-Keras Theano-Keras CNTK
TensorFlow	
Workflow
.....
Why Keras?
• Focuses on Developer Experience
• Popular & Broader Community
• Supports multiple backends
• Modularity
• Sequential
• Functional
model = Sequential()
model.add(Dense(32, input_dim=784))
model.add(Activation('relu'))
model.add(Dense, 32, activation=’softmax’)
...
Keras Code: MNIST
from keras import models
from keras import layers
mnist = tf.keras.datasets.mnist
(train_images, train_labels),(test_images, test_labels)=
prepare_data(mnist.load_data())
network= models.Sequential()
network.add(layers.Dense(512, activation=‘relu’,
input_shape(28 * 28,)))
network.add(layers.Dense(10, activation=‘softmax’))
network.compile(optimizer=’rmsprop',
loss='categorical_crossentropy',
metrics=['accuracy'])
network.fit(train_images, train_labels, epochs=5,
batch_size=128 )
results = network.evaluate(test_images, test_labels)
Set up code & use dataset
Define Network
Fit Network
Compile Network
Evaluate Network
predictions = network.predict(new_images) Make Predictions
Repeatable
Another a Simple Network Model:Which code is easier to read?
What is PyTorch?
• Open source from Facebook, 2017
– v1.0 dev release
• Primarily a Python Package
• Tensor Computations
– Torch.tensor -> CPU, GPU/CUDA
• Dynamic NN: Tape-based Autograd
• Graph Based Dynamic Computations
• Imperative Toolkit
PyTorch Programming Stack
Python API
Auto Differentiation
Engine
Numpy Library
(GPU Support )
Gradient Based
Optimized Package
Utilities
(Data, Text, Video..)
Deep Learning &
Reinforcement
Learning
Numpy Alternative
Ndarray <->torch.Tensor
Optimized: Adam,
Adamax, RMSProp,
SGD, LBFGS ...
Data loading: SciPy,
SpaCy, OpenCV,
PIL, torchvision
CPU CPU GPU GPU...
Why PyTorch?
• Imperative Experience
– Rapid Prototyping for Research
– Easy Debugging & TBX
• Quick Ramp-up time
• Decent Docs & Community
– 275K Downloads
– 1900 Community Repos
– 13+K Blogs Posts
• Pythonic!
PyTorch Key API Concepts
• Variables & Autograd
• Torch Tensors
• Operations
•
from torch import Variable
x = Variable(torch.Tensor([2]),requires_grad=True)
y = 5*x**4 + 3*x**3 + 7*x**2 + 9*x - 5
y.backward() #compute gradient and backpropagate
x.grad
#different kinds of Torch Tensors
x = torch.rand(5, 3);
y = torch.rand(5, 3)
t = torch.tensor([5.5, 3])
n = torch.tensor(np.array([[1, 2, 3], [4, 5, 6]]))
#operations or element-wise operations
a = (x + y)
m = (x * y)
if torch.cuda.is_available():
x = x.cuda()
y = y.cuda()
torch.add(x, y, out=result)
print(a, m, out)
PyTorch Rhythm ...
Design Model with
Autograd Variables
Construct Loss and
Optimizer
Training
Cycle
1
.
2
Design a model using PyTorch Autograd
Variables
Construct a loss function and optimizer with
PyTorch APIs
Train your model: forward, backward, and
update steps
1. 1
1
3
.
2
.
2
3.
2.
PyTorch Rhythm : Linear Regression
https://www.youtube.com/watch?v=113b7O3mabY (Sung Kim)
Training Options
Options
1) Train on single node
2) Train on single node, distributed inference
3) Distributed training
Horovod
● Created by Alexander Sergeev of Uber, open-sourced in 2017
● Simplifies distributed neural network training
● Supports TensorFlow, Keras, and PyTorch
Classical Parameter Server
All-Reduce
Minimal Code Change
TensorFlow, Keras, or
PyTorch?
Takeaways: Gaining Momentum...
Keras
TensorFlow
PyTorch
TensorFlow Keras
Takeaways: When to Use TF, Keras or PyTorch
PyTorch
• Low-level APIs & Control
• Model Serving
• Supports multiple
languages
• High-level APIs
• MultipleBackends
• LovePython
• Rapid Experimentation
• Pythonic!
• Imperative
Programming
• RapidExperimentation
Databricks Runtime for Machine Learning
Ready to use clusters with built-in ML Frameworks
includingTensorFlow, Keras, Horovod, andmore
Horovod Estimator
for simplifieddistributedtrainingon TensorFlowwith HorovodusingApache Spark on Databricks
GPU support
on AWS (P2/P3) andAzure (NC/NC-v3) instancesnow supported!
Resources & BooksBlogposts Talk, & webinars (http://databricks.com/blog)
• GPU acceleration in Databricks
• Deep Learning and ApacheSpark
• fast.ai
• TensorFlowTutorials
• TensorFlowDev Summit
• Keras/TensorFlowTutorials
• PyTorch Docs & Tutorials
• Talk-1from Soumith Chintala
• Talk-2from Soumith Chintala
• MLflow.org
Docs for Deep Learning on Databricks (http://docs.databricks.com)
• Databricks RuntimeML
• HorovodEstimator
Thank You!
Questions?
brooke@databricks.com
jules@databricks.com (@2twitme)

More Related Content

What's hot

Birch Algorithm With Solved Example
Birch Algorithm With Solved ExampleBirch Algorithm With Solved Example
Birch Algorithm With Solved Examplekailash shaw
 
Digital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing: Image Enhancement in the Frequency DomainDigital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing: Image Enhancement in the Frequency DomainMostafa G. M. Mostafa
 
Tensor representations in signal processing and machine learning (tutorial ta...
Tensor representations in signal processing and machine learning (tutorial ta...Tensor representations in signal processing and machine learning (tutorial ta...
Tensor representations in signal processing and machine learning (tutorial ta...Tatsuya Yokota
 
Optimization for Deep Learning
Optimization for Deep LearningOptimization for Deep Learning
Optimization for Deep LearningSebastian Ruder
 
Machine Learning - Introduction to Convolutional Neural Networks
Machine Learning - Introduction to Convolutional Neural NetworksMachine Learning - Introduction to Convolutional Neural Networks
Machine Learning - Introduction to Convolutional Neural NetworksAndrew Ferlitsch
 
Deep Learning for Semantic Search in E-commerce​
Deep Learning for Semantic Search in E-commerce​Deep Learning for Semantic Search in E-commerce​
Deep Learning for Semantic Search in E-commerce​Somnath Banerjee
 
Yurii Pashchenko: Zero-shot learning capabilities of CLIP model from OpenAI
Yurii Pashchenko: Zero-shot learning capabilities of CLIP model from OpenAIYurii Pashchenko: Zero-shot learning capabilities of CLIP model from OpenAI
Yurii Pashchenko: Zero-shot learning capabilities of CLIP model from OpenAILviv Startup Club
 
Multi-Layer Perceptrons
Multi-Layer PerceptronsMulti-Layer Perceptrons
Multi-Layer PerceptronsESCOM
 
Chapter 8 image compression
Chapter 8 image compressionChapter 8 image compression
Chapter 8 image compressionasodariyabhavesh
 
Zero shot learning through cross-modal transfer
Zero shot learning through cross-modal transferZero shot learning through cross-modal transfer
Zero shot learning through cross-modal transferRoelof Pieters
 
Image Classification Done Simply using Keras and TensorFlow
Image Classification Done Simply using Keras and TensorFlow Image Classification Done Simply using Keras and TensorFlow
Image Classification Done Simply using Keras and TensorFlow Rajiv Shah
 
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...Edureka!
 
Dimensionality Reduction
Dimensionality ReductionDimensionality Reduction
Dimensionality Reductionmrizwan969
 
Introduction to object detection
Introduction to object detectionIntroduction to object detection
Introduction to object detectionAmar Jindal
 

What's hot (20)

Birch Algorithm With Solved Example
Birch Algorithm With Solved ExampleBirch Algorithm With Solved Example
Birch Algorithm With Solved Example
 
Digital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing: Image Enhancement in the Frequency DomainDigital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing: Image Enhancement in the Frequency Domain
 
Tensor representations in signal processing and machine learning (tutorial ta...
Tensor representations in signal processing and machine learning (tutorial ta...Tensor representations in signal processing and machine learning (tutorial ta...
Tensor representations in signal processing and machine learning (tutorial ta...
 
Optimization for Deep Learning
Optimization for Deep LearningOptimization for Deep Learning
Optimization for Deep Learning
 
Machine Learning - Introduction to Convolutional Neural Networks
Machine Learning - Introduction to Convolutional Neural NetworksMachine Learning - Introduction to Convolutional Neural Networks
Machine Learning - Introduction to Convolutional Neural Networks
 
Bayesian learning
Bayesian learningBayesian learning
Bayesian learning
 
Module 31
Module 31Module 31
Module 31
 
Image Segmentation Using PYTHON
Image Segmentation Using PYTHONImage Segmentation Using PYTHON
Image Segmentation Using PYTHON
 
Deep Learning for Semantic Search in E-commerce​
Deep Learning for Semantic Search in E-commerce​Deep Learning for Semantic Search in E-commerce​
Deep Learning for Semantic Search in E-commerce​
 
Yurii Pashchenko: Zero-shot learning capabilities of CLIP model from OpenAI
Yurii Pashchenko: Zero-shot learning capabilities of CLIP model from OpenAIYurii Pashchenko: Zero-shot learning capabilities of CLIP model from OpenAI
Yurii Pashchenko: Zero-shot learning capabilities of CLIP model from OpenAI
 
Randomized smoothing
Randomized smoothingRandomized smoothing
Randomized smoothing
 
Lecture 09: SLAM
Lecture 09: SLAMLecture 09: SLAM
Lecture 09: SLAM
 
Multi-Layer Perceptrons
Multi-Layer PerceptronsMulti-Layer Perceptrons
Multi-Layer Perceptrons
 
Chapter 8 image compression
Chapter 8 image compressionChapter 8 image compression
Chapter 8 image compression
 
Zero shot learning through cross-modal transfer
Zero shot learning through cross-modal transferZero shot learning through cross-modal transfer
Zero shot learning through cross-modal transfer
 
Image Classification Done Simply using Keras and TensorFlow
Image Classification Done Simply using Keras and TensorFlow Image Classification Done Simply using Keras and TensorFlow
Image Classification Done Simply using Keras and TensorFlow
 
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...
 
Dimensionality Reduction
Dimensionality ReductionDimensionality Reduction
Dimensionality Reduction
 
Lzw coding technique for image compression
Lzw coding technique for image compressionLzw coding technique for image compression
Lzw coding technique for image compression
 
Introduction to object detection
Introduction to object detectionIntroduction to object detection
Introduction to object detection
 

Similar to A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with Brooke Wenig and Jules Damji

Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scalaAutomate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scalaChetan Khatri
 
Language translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlowLanguage translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlowS N
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Ganesan Narayanasamy
 
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...Codemotion
 
Machine learning with py torch
Machine learning with py torchMachine learning with py torch
Machine learning with py torchRiza Fahmi
 
NUS-ISS Learning Day 2019-Deploying AI apps using tensor flow lite in mobile ...
NUS-ISS Learning Day 2019-Deploying AI apps using tensor flow lite in mobile ...NUS-ISS Learning Day 2019-Deploying AI apps using tensor flow lite in mobile ...
NUS-ISS Learning Day 2019-Deploying AI apps using tensor flow lite in mobile ...NUS-ISS
 
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...Chris Fregly
 
slide-keras-tf.pptx
slide-keras-tf.pptxslide-keras-tf.pptx
slide-keras-tf.pptxRithikRaj25
 
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...Chetan Khatri
 
Bring your neural networks to the browser with TF.js - Simone Scardapane
Bring your neural networks to the browser with TF.js - Simone ScardapaneBring your neural networks to the browser with TF.js - Simone Scardapane
Bring your neural networks to the browser with TF.js - Simone ScardapaneMeetupDataScienceRoma
 
Anirudh Koul. 30 Golden Rules of Deep Learning Performance
Anirudh Koul. 30 Golden Rules of Deep Learning PerformanceAnirudh Koul. 30 Golden Rules of Deep Learning Performance
Anirudh Koul. 30 Golden Rules of Deep Learning PerformanceLviv Startup Club
 
Spark Summit EU talk by Tim Hunter
Spark Summit EU talk by Tim HunterSpark Summit EU talk by Tim Hunter
Spark Summit EU talk by Tim HunterSpark Summit
 
Deep Learning and TensorFlow
Deep Learning and TensorFlowDeep Learning and TensorFlow
Deep Learning and TensorFlowOswald Campesato
 
Google Big Data Expo
Google Big Data ExpoGoogle Big Data Expo
Google Big Data ExpoBigDataExpo
 
A Tour of Tensorflow's APIs
A Tour of Tensorflow's APIsA Tour of Tensorflow's APIs
A Tour of Tensorflow's APIsDean Wyatte
 
Machine Learning and Go. Go!
Machine Learning and Go. Go!Machine Learning and Go. Go!
Machine Learning and Go. Go!Diana Ortega
 
OpenPOWER Workshop in Silicon Valley
OpenPOWER Workshop in Silicon ValleyOpenPOWER Workshop in Silicon Valley
OpenPOWER Workshop in Silicon ValleyGanesan Narayanasamy
 
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017Amazon Web Services
 
Standardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for PythonStandardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for PythonRalf Gommers
 

Similar to A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with Brooke Wenig and Jules Damji (20)

Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scalaAutomate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
 
Language translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlowLanguage translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlow
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117
 
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
 
Machine learning with py torch
Machine learning with py torchMachine learning with py torch
Machine learning with py torch
 
NUS-ISS Learning Day 2019-Deploying AI apps using tensor flow lite in mobile ...
NUS-ISS Learning Day 2019-Deploying AI apps using tensor flow lite in mobile ...NUS-ISS Learning Day 2019-Deploying AI apps using tensor flow lite in mobile ...
NUS-ISS Learning Day 2019-Deploying AI apps using tensor flow lite in mobile ...
 
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
 
slide-keras-tf.pptx
slide-keras-tf.pptxslide-keras-tf.pptx
slide-keras-tf.pptx
 
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
 
Bring your neural networks to the browser with TF.js - Simone Scardapane
Bring your neural networks to the browser with TF.js - Simone ScardapaneBring your neural networks to the browser with TF.js - Simone Scardapane
Bring your neural networks to the browser with TF.js - Simone Scardapane
 
Anirudh Koul. 30 Golden Rules of Deep Learning Performance
Anirudh Koul. 30 Golden Rules of Deep Learning PerformanceAnirudh Koul. 30 Golden Rules of Deep Learning Performance
Anirudh Koul. 30 Golden Rules of Deep Learning Performance
 
Spark Summit EU talk by Tim Hunter
Spark Summit EU talk by Tim HunterSpark Summit EU talk by Tim Hunter
Spark Summit EU talk by Tim Hunter
 
Deep Learning and TensorFlow
Deep Learning and TensorFlowDeep Learning and TensorFlow
Deep Learning and TensorFlow
 
Meetup tensorframes
Meetup tensorframesMeetup tensorframes
Meetup tensorframes
 
Google Big Data Expo
Google Big Data ExpoGoogle Big Data Expo
Google Big Data Expo
 
A Tour of Tensorflow's APIs
A Tour of Tensorflow's APIsA Tour of Tensorflow's APIs
A Tour of Tensorflow's APIs
 
Machine Learning and Go. Go!
Machine Learning and Go. Go!Machine Learning and Go. Go!
Machine Learning and Go. Go!
 
OpenPOWER Workshop in Silicon Valley
OpenPOWER Workshop in Silicon ValleyOpenPOWER Workshop in Silicon Valley
OpenPOWER Workshop in Silicon Valley
 
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
 
Standardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for PythonStandardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for Python
 

More from Databricks

DW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDatabricks
 
Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1Databricks
 
Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2Databricks
 
Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Databricks
 
Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Databricks
 
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of HadoopDatabricks
 
Democratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDemocratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDatabricks
 
Learn to Use Databricks for Data Science
Learn to Use Databricks for Data ScienceLearn to Use Databricks for Data Science
Learn to Use Databricks for Data ScienceDatabricks
 
Why APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML MonitoringWhy APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML MonitoringDatabricks
 
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch FixThe Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch FixDatabricks
 
Stage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationStage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationDatabricks
 
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchSimplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchDatabricks
 
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesScaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesDatabricks
 
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark PipelinesScaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark PipelinesDatabricks
 
Sawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsSawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsDatabricks
 
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkRedis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkDatabricks
 
Re-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkRe-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkDatabricks
 
Raven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesRaven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesDatabricks
 
Processing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkProcessing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkDatabricks
 
Massive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta LakeMassive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta LakeDatabricks
 

More from Databricks (20)

DW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptx
 
Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1
 
Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2
 
Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2
 
Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4
 
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
 
Democratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDemocratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized Platform
 
Learn to Use Databricks for Data Science
Learn to Use Databricks for Data ScienceLearn to Use Databricks for Data Science
Learn to Use Databricks for Data Science
 
Why APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML MonitoringWhy APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML Monitoring
 
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch FixThe Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
 
Stage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationStage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI Integration
 
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchSimplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorch
 
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesScaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on Kubernetes
 
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark PipelinesScaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
 
Sawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsSawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature Aggregations
 
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkRedis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
 
Re-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkRe-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and Spark
 
Raven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesRaven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction Queries
 
Processing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkProcessing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache Spark
 
Massive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta LakeMassive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta Lake
 

Recently uploaded

Business Analytics using Microsoft Excel
Business Analytics using Microsoft ExcelBusiness Analytics using Microsoft Excel
Business Analytics using Microsoft Excelysmaelreyes
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改yuu sss
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.natarajan8993
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxaleedritatuxx
 
Semantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxSemantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxMike Bennett
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Cathrine Wilhelmsen
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...Amil Baba Dawood bangali
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfchwongval
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queensdataanalyticsqueen03
 
Defining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryDefining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryJeremy Anderson
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 
IMA MSN - Medical Students Network (2).pptx
IMA MSN - Medical Students Network (2).pptxIMA MSN - Medical Students Network (2).pptx
IMA MSN - Medical Students Network (2).pptxdolaknnilon
 
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一F La
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]📊 Markus Baersch
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPTBoston Institute of Analytics
 
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024Susanna-Assunta Sansone
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理e4aez8ss
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024thyngster
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our WorldEduminds Learning
 

Recently uploaded (20)

Business Analytics using Microsoft Excel
Business Analytics using Microsoft ExcelBusiness Analytics using Microsoft Excel
Business Analytics using Microsoft Excel
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
 
Semantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxSemantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptx
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdf
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queens
 
Defining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryDefining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data Story
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 
IMA MSN - Medical Students Network (2).pptx
IMA MSN - Medical Students Network (2).pptxIMA MSN - Medical Students Network (2).pptx
IMA MSN - Medical Students Network (2).pptx
 
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
 
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our World
 

A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with Brooke Wenig and Jules Damji

  • 1. A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, and PyTorch Brooke Wenig Jules S. Damji Spark + AI Summit, London 4October 2018
  • 2. About Us . . . Machine LearningPractice Lead @ Databricks Data Science @ Splunk & MyFitnessPal MS Machine Learning(UCLA) Fluentin Chinese https://www.linkedin.com/in/brookewenig/ Brooke WenigJules S. Damji Apache Spark Developer& Community Advocate @Databricks Program Chair Spark + AI Summit Software engineering @Sun Microsystems, Netscape, @Home, VeriSign, Scalix, Centrify, LoudCloud/Opsware, ProQuest https://www.linkedin.com/in/dmatrix @2twitme
  • 3. Agenda for Today’s Talk • What’s Deep Learning and Why? • Short Survey of 3 DL Frameworks • TensorFlow • Keras • PyTorch • Training Options • Single Node • Distributed • Q&A
  • 4. What is Deep Learning? “Composing representations of data in a hierarchical manner”
  • 7. Zoo of DL Frameworks: Which One? DPL
  • 8. Survey of Three Deep Learning Frameworks
  • 9. What’s TensorFlow? • Open source from Google, 2015 • Current v1.12 API • 2.0 Coming Soon... :) • Declarative Toolkit • Fast: Backend C/C++ • Data flow graphs • Nodes are functions/operators • Edges are input or data (tensors) • Lazy execution • Eager execution (1.7)
  • 10. TensorFlow Key API Concepts • Constants • Variables • Placeholders • Operations • Sessions • Tensors • Graphs • x = tf.constants (42, name= ‘x’) w = tf.Variable(1.34,name=’w’) input= tf.Placeholder(“float”) c = tf.add(x, w); m = tf.matmul(a, b) ... with tf.Session([URI]) as sess: 1, [1, 2], [[2, 3], [4, 5]] ... g = tf.Graph(“my_graph”) withg.as_default(): c = tf.add(x,w) m= tf.matmul(a, b)
  • 11. TensorFlow Code import tensorflow as tf a = tf.placeholder(tf.float32, shape=(2,1)) b = tf.placeholder(tf.float32, shape=(1,2)) c = tf.matmul(a, b) sess = tf.Session() print(sess.run(c, {a: [[1],[2]], b:[[3,4]]})) [[3. 4.] [6. 8.]] Create a TF Session Run the session, with input parameters for place holders ‘a’ & ’b’ ‘c’ as an operation won’t to run until sess.run() Lazily evaluated. TF matmul matrix operation TF session output Create TF placeholder types, a & b Define their input shape as tensors
  • 12. TensorFlow Code: MNIST import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) # Create the model x = tf.placeholder(tf.float32, [None, 784]) W = tf.Variable(tf.zeros([784, 10])) b = tf.Variable(tf.zeros([10])) y = tf.matmul(x, W) + b y_ = tf.placeholder(tf.int64, [None]) ... # Define loss and optimizer cross_entropy = tf.losses.sparse_softmax_cross_entropy(labels=y_, logits=y) train_step = tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy) #create session, train, and evaluate sess = tf.InteractiveSession() tf.global_variables_initializer().run() # Train for _ in range(1000): batch_xs, batch_ys = mnist.train.next_batch(100) sess.run(train_step, feed_dict={x: batch_xs, y_: batch_ys}) # Test trained model correct_prediction = tf.equal(tf.argmax(y, 1), y_) accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32)) ... print(sess.run(accuracy, feed_dict={ x: mnist.test.images, y_: mnist.test.labels })) https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/mnist_softmax.py Use tf input_data modules for MNIST TF placeholders & variables Define our model TF variable for predicted value y’ Define our loss function: cross_entropy Use Gradient Descent Optimizer Train or evaluate the model
  • 13. TensorFlow Programming Stack CPU GPU Android iOS …TPU Use canned estimators Build models Keras Models
  • 14. Why TensorFlow: Community AF AF • 105K+ stars! • 11+M downloads • Popular open-source code • TensorFlow Hub & Blog ○ Code Examples & Tutorials! ○ Learn + share from others
  • 15. Why TensorFlow: Tools AF AF Deploy + Serve Models TFX Visualize Tensors flow
  • 16. TensorFlow: We Get it … So What? • Steep learning curve, but powerful!! • Low-level APIs, butoffers control!! • Expert in Machine Learning, justlearn!! • Yet, high-level Estimators help, you bet!! • Yeah, TensorFlow 2.0, ease-of-use,eagerexecution! • Better, Keras integration helps, indeed!!
  • 17. What’s Keras? • Open source Python Library APIs for Deep Learning • Current v2.2.2 APIs François Chollet (Google) • APIs : with TensorFlow, CNTK and Theano Backends • Easy to UseHigh-Level DeclarativeAPIs! • Build layers – Great for Neural Network Applications – CNN – RNN & LSTM • Fast Experimentation,Modular & Extensible!
  • 18. Keras Programming Stack CPU GPU Android iOS …TPU Use canned estimators Specific Runtime Backend Impl models Python Keras API TF-Keras Theano-Keras CNTK TensorFlow Workflow .....
  • 19. Why Keras? • Focuses on Developer Experience • Popular & Broader Community • Supports multiple backends • Modularity • Sequential • Functional model = Sequential() model.add(Dense(32, input_dim=784)) model.add(Activation('relu')) model.add(Dense, 32, activation=’softmax’) ...
  • 20. Keras Code: MNIST from keras import models from keras import layers mnist = tf.keras.datasets.mnist (train_images, train_labels),(test_images, test_labels)= prepare_data(mnist.load_data()) network= models.Sequential() network.add(layers.Dense(512, activation=‘relu’, input_shape(28 * 28,))) network.add(layers.Dense(10, activation=‘softmax’)) network.compile(optimizer=’rmsprop', loss='categorical_crossentropy', metrics=['accuracy']) network.fit(train_images, train_labels, epochs=5, batch_size=128 ) results = network.evaluate(test_images, test_labels) Set up code & use dataset Define Network Fit Network Compile Network Evaluate Network predictions = network.predict(new_images) Make Predictions Repeatable
  • 21. Another a Simple Network Model:Which code is easier to read?
  • 22. What is PyTorch? • Open source from Facebook, 2017 – v1.0 dev release • Primarily a Python Package • Tensor Computations – Torch.tensor -> CPU, GPU/CUDA • Dynamic NN: Tape-based Autograd • Graph Based Dynamic Computations • Imperative Toolkit
  • 23. PyTorch Programming Stack Python API Auto Differentiation Engine Numpy Library (GPU Support ) Gradient Based Optimized Package Utilities (Data, Text, Video..) Deep Learning & Reinforcement Learning Numpy Alternative Ndarray <->torch.Tensor Optimized: Adam, Adamax, RMSProp, SGD, LBFGS ... Data loading: SciPy, SpaCy, OpenCV, PIL, torchvision CPU CPU GPU GPU...
  • 24. Why PyTorch? • Imperative Experience – Rapid Prototyping for Research – Easy Debugging & TBX • Quick Ramp-up time • Decent Docs & Community – 275K Downloads – 1900 Community Repos – 13+K Blogs Posts • Pythonic!
  • 25. PyTorch Key API Concepts • Variables & Autograd • Torch Tensors • Operations • from torch import Variable x = Variable(torch.Tensor([2]),requires_grad=True) y = 5*x**4 + 3*x**3 + 7*x**2 + 9*x - 5 y.backward() #compute gradient and backpropagate x.grad #different kinds of Torch Tensors x = torch.rand(5, 3); y = torch.rand(5, 3) t = torch.tensor([5.5, 3]) n = torch.tensor(np.array([[1, 2, 3], [4, 5, 6]])) #operations or element-wise operations a = (x + y) m = (x * y) if torch.cuda.is_available(): x = x.cuda() y = y.cuda() torch.add(x, y, out=result) print(a, m, out)
  • 26. PyTorch Rhythm ... Design Model with Autograd Variables Construct Loss and Optimizer Training Cycle 1 . 2 Design a model using PyTorch Autograd Variables Construct a loss function and optimizer with PyTorch APIs Train your model: forward, backward, and update steps 1. 1 1 3 . 2 . 2 3. 2.
  • 27. PyTorch Rhythm : Linear Regression https://www.youtube.com/watch?v=113b7O3mabY (Sung Kim)
  • 29. Options 1) Train on single node 2) Train on single node, distributed inference 3) Distributed training
  • 30. Horovod ● Created by Alexander Sergeev of Uber, open-sourced in 2017 ● Simplifies distributed neural network training ● Supports TensorFlow, Keras, and PyTorch
  • 36. TensorFlow Keras Takeaways: When to Use TF, Keras or PyTorch PyTorch • Low-level APIs & Control • Model Serving • Supports multiple languages • High-level APIs • MultipleBackends • LovePython • Rapid Experimentation • Pythonic! • Imperative Programming • RapidExperimentation
  • 37. Databricks Runtime for Machine Learning Ready to use clusters with built-in ML Frameworks includingTensorFlow, Keras, Horovod, andmore Horovod Estimator for simplifieddistributedtrainingon TensorFlowwith HorovodusingApache Spark on Databricks GPU support on AWS (P2/P3) andAzure (NC/NC-v3) instancesnow supported!
  • 38. Resources & BooksBlogposts Talk, & webinars (http://databricks.com/blog) • GPU acceleration in Databricks • Deep Learning and ApacheSpark • fast.ai • TensorFlowTutorials • TensorFlowDev Summit • Keras/TensorFlowTutorials • PyTorch Docs & Tutorials • Talk-1from Soumith Chintala • Talk-2from Soumith Chintala • MLflow.org Docs for Deep Learning on Databricks (http://docs.databricks.com) • Databricks RuntimeML • HorovodEstimator