Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GIDS18_SupriyaSrivatsa.pdf
Search
Supriya Srivatsa
April 24, 2018
Technology
0
590
GIDS18_SupriyaSrivatsa.pdf
Supriya Srivatsa
April 24, 2018
Tweet
Share
More Decks by Supriya Srivatsa
See All by Supriya Srivatsa
Forgotten Histories
supriyasrivatsa
0
650
The Story of Villagers, Marbles and Oh, A Blockchain!
supriyasrivatsa
0
620
Going Multiplatform With Kotlin
supriyasrivatsa
0
720
Mobile, AI and TensorFlow
supriyasrivatsa
0
610
Other Decks in Technology
See All in Technology
What happened to RubyGems and what can we learn?
mikemcquaid
0
300
今日から始めるAmazon Bedrock AgentCore
har1101
4
410
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
330
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
Bill One 開発エンジニア 紹介資料
sansan33
PRO
5
17k
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
0
150
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
320
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
210
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
240
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
470
Digitization部 紹介資料
sansan33
PRO
1
6.8k
Featured
See All Featured
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Optimising Largest Contentful Paint
csswizardry
37
3.6k
Done Done
chrislema
186
16k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
280
So, you think you're a good person
axbom
PRO
2
1.9k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
780
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
300
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
3.9k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Navigating Weather and Climate Data
rabernat
0
110
Speed Design
sergeychernyshev
33
1.5k
Transcript
TensorFlow for Mobile Machine Learning Supriya Srivatsa, Software Engineer, Xome
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
AI AND MOBILE – THE CONVERGENCE
INFERENCE - TODAY AND TOMORROW
The “Transfer to Infer” Approach
Why On Device Prediction • Data Privacy • Poor Internet
Connection • Questionable User Experience
Why On Device Prediction Case Study: Portrait Mode
TENSORFLOW PRIMER
None
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)
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
None
None
TENSORFLOW IN YOUR POCKET
Pick Your Weapon • Choose a pre-trained TF Model –
Inception V3 Model – MNIST – Smart Reply – Deep Speech • Build a TF Model
Sharpen your Sword • Retrain Model as required.
Neural Network and Transfer Learning
None
TENSORFLOW MOBILE VS TENSORFLOW LITE
TensorFlow Lite • Smaller binary size, better performance. • Ability
to leverage hardware acceleration. • Only supports a limited set of operators.
TensorFlow Mobile and TensorFlow Lite
TensorFlow Mobile and TensorFlow Lite
TensorFlow Mobile and TensorFlow Lite
Optimization • optimize_for_inference • Quantization
Quantization • Round it up • Transform: round_weights • Compression
rates: ~8% => ~70% • Shrink down node names • Transform: obfuscate_names • Eight bit calculations
Quantization – Eight Bit Calculations
Optimization – Before and After
TensorFlow Mobile and TensorFlow Lite
TensorFlow Mobile and TensorFlow Lite
TensorFlow Lite • TOCO – TensorFlow Lite Optimizing Converter –
Pruning unused nodes. – Performance Improvements. – Convert to tflite format. (Generate FlatBuffer file.)
ü Frozen ü Optimized, Quantized ü .tflite / FlatBuffer
How does it work?
Packaging App and Model
CODE AWAY J
Code Away – Gradle Files
Code Away :) Tflite = new Interpreter(<loadmodelfile>) tflite.run(giveInput, outputObject) •
Create Interpreter • Run model with input, fetch output.
POKÉDEMO!
PokéDemo
APPLICATIONS AND CASE STUDIES
Coca Cola
Google Assistant
Smart Reply
Q & A
Thank you