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
Mobile, AI and TensorFlow
Search
Supriya Srivatsa
October 05, 2017
Technology
630
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Mobile, AI and TensorFlow
Supriya Srivatsa
October 05, 2017
More Decks by Supriya Srivatsa
See All by Supriya Srivatsa
Forgotten Histories
supriyasrivatsa
0
660
The Story of Villagers, Marbles and Oh, A Blockchain!
supriyasrivatsa
0
640
Going Multiplatform With Kotlin
supriyasrivatsa
0
740
GIDS18_SupriyaSrivatsa.pdf
supriyasrivatsa
0
610
Other Decks in Technology
See All in Technology
DatadogのBits Chatが開発組織にもたらしたもの / What Bits Chat Has Brought Us
sms_tech
1
260
Sets in Go
ramalho
1
640
社内の7割が使うデータ基盤を、 データチーム2人で回すためにやったこと
koh_yoshi
4
1.3k
ブラウザ研修 2026
recruitengineers
PRO
6
990
Data Hubグループ 紹介資料
sansan33
PRO
0
3.2k
その“隠したつもり”が命取り ── 自前と平文をやめて「正解」に委ねる
kuroneko13
0
120
Breaking the Seal: Static Deobfuscation of Compiled V8 JavaScript Bytecode Malware
hshrzd
0
760
MIRU 2026 チュートリアル
keisuke198619
0
910
FORENSIA: ローカルLLMフォレンジックハーネス
sumeshi
2
390
侵入は突然に 〜 IoTマルウェアと悪用される家庭の機器 ~ / When Intrusion Strikes: IoT Malware and the Abuse of Home Devices
nttcom
0
4k
【CEDEC2026】次世代デジタルカードゲームのサーバー設計と運用 〜『Shadowverse: Worlds Beyond』の舞台裏~
cygames
PRO
1
1.3k
【CEDEC2026】グラフィックスエンジニアのためのニューラルシェーディング入門
cygames
PRO
0
150
Featured
See All Featured
BBQ
matthewcrist
89
10k
My Coaching Mixtape
mlcsv
0
230
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
460
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
The Limits of Empathy - UXLibs8
cassininazir
1
600
Crafting Experiences
bethany
1
250
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
520
Designing for Performance
lara
611
70k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.8k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Rails Girls Zürich Keynote
gr2m
96
14k
Transcript
Mobile, AI and Tensorflow Supriya Srivatsa
None
None
NEURAL NETWORKS Human anatomy inspired learning network.
Neural Networks
Neural Networks
Neural Network – A Peek Inside
Deep Neural Network
PREDICTION AND INFERENCE How it works today. How it shall
work tomorrow.
“Transfer to Infer” Approach
Why On-Device Prediction • Data Privacy • Poor internet connections
• Questionable user experience
To The Rescue…
TensorFlow • Tensor: N Dimensional Arrays • Open source software
library for numerical computation using data flow graphs.
TensorFlow – Data Flow Graphs • Nodes represent mathematical functions
• Edges represent tensors.
Tensorflow – “Deferred Execution” Model • Graph first. Computation Afterward.
import tensorflow as tf x = tf.constant(10) y = tf.Variable(x + 5) print(y)
Tensorflow – “Deferred Execution” Model • Graph first. Computation Afterward.
import tensorflow as tf x = tf.constant(10) y = tf.Variable(x + 5) model = tf.global_variables_initializer() with tf.Session() as session: session.run(model) print(session.run(y))
None
None
Packaging the App and the Model
QUANTIZATION Compress. And Compress More.
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
Quantization - Eight Bit Calculations
None
IMPLEMENTATION Code Away! ☺
Implementation build.gradle buildscript { repositories { jcenter() } dependencies {
classpath 'com.android.tools.build:gradle:2.3.0' } }
Implementation 1. Load 2. Feed 3. Run 4. Fetch
Implementation 1. Load the model 2. Feed in the input
3. Run the model 4. Fetch the output TensorFlowInferenceInterface inferenceInterface = new TensorFlowInferenceInterface(assetManager, modelFile);
Implementation 1. Load the model 2. Feed in the input
3. Run the model 4. Fetch the output // feed(String s, float[] floats, long… longs) inferenceInterface.feed(inputName, floatValues, 1, inputSize, inputSize, 3);
Implementation 1. Load the model 2. Feed in the input
3. Run the model 4. Fetch the output inferenceInterface.run(outputNames);
Implementation 1. Load the model 2. Feed in the input
3. Run the model 4. Fetch the output // fetch(String s, float[] floats) inferenceInterface.fetch(outputName, outputs);
APPLICATIONS Awesomeness.
Google Translate
None
None