TensorFlow for Mobile Machine Learning
Supriya Srivatsa, Software Engineer, Xome
Slide 2
Slide 2 text
Overview
• AI and Mobile – the Convergence
• Inference – Today and Tomorrow
• TensorFlow Primer
• TensorFlow in your Pocket
– TensorFlow Mobile
– TensorFlow Lite
• PokéDemo
• Applications and Case Studies
• Q & A
Slide 3
Slide 3 text
AI AND MOBILE – THE CONVERGENCE
Slide 4
Slide 4 text
INFERENCE - TODAY AND TOMORROW
Slide 5
Slide 5 text
The “Transfer to Infer” Approach
Slide 6
Slide 6 text
Why On Device Prediction
• Data Privacy
• Poor Internet Connection
• Questionable User Experience
Slide 7
Slide 7 text
Why On Device Prediction
Case Study: Portrait Mode
Slide 8
Slide 8 text
TENSORFLOW PRIMER
Slide 9
Slide 9 text
No content
Slide 10
Slide 10 text
TensorFlow – Deferred Execution Model
(Building the Computational Graph)
import tensorflow as tf
num1 = tf.constant(5)
num2 = tf.constant(10)
sum = num1 + num2
print(sum)
#O/P: Tensor("add:0", shape=(), dtype=int32)
Slide 11
Slide 11 text
TensorFlow – Deferred Execution Model
(Running the Computational Graph)
import tensorflow as tf
num1 = tf.constant(5)
num2 = tf.constant(10)
sum = num1 + num2
with tf.Session() as sess:
print(sess.run(sum))
#O/P: 15
Slide 12
Slide 12 text
No content
Slide 13
Slide 13 text
No content
Slide 14
Slide 14 text
TENSORFLOW
IN YOUR POCKET
Slide 15
Slide 15 text
Pick Your Weapon
• Choose a pre-trained TF Model
– Inception V3 Model
– MNIST
– Smart Reply
– Deep Speech
• Build a TF Model
Slide 16
Slide 16 text
Sharpen your Sword
• Retrain Model as required.
Slide 17
Slide 17 text
Neural Network and Transfer Learning
Slide 18
Slide 18 text
No content
Slide 19
Slide 19 text
TENSORFLOW MOBILE
VS
TENSORFLOW LITE
Slide 20
Slide 20 text
TensorFlow Lite
• Smaller binary size, better
performance.
• Ability to leverage hardware
acceleration.
• Only supports a limited set
of operators.