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
620
0
Share
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
630
Going Multiplatform With Kotlin
supriyasrivatsa
0
730
GIDS18_SupriyaSrivatsa.pdf
supriyasrivatsa
0
600
Other Decks in Technology
See All in Technology
Agent Skillsで実現する記憶領域の運用とその後
yamadashy
2
1.6k
試作とデモンストレーション / Prototyping and Demonstrations
ks91
PRO
0
200
Building Production-Ready Agents Microsoft Agent Framework
_mertmetin
0
160
新卒エンジニア研修、ハンズオンの設計における課題と実践知/ #tachikawaany
nishiuma
2
140
「背中を見て育て」からの卒業 〜専門技術としてのテスト設計を軸に、品質保証のバトンを繋ぐ〜 #genda_tech_talk
nihonbuson
PRO
2
1.1k
アプリブロック機能のつくりかたと、AIとHTMLの不合理な相性の良さについて
kumamotone
1
230
Sociotechnical Architecture Reviews: Understanding Teams, not just Artefacts
ewolff
1
160
色を視る
yuzneri
0
330
AI時代の品質はテストプロセスの作り直し #scrumniigata
kyonmm
PRO
4
1.4k
(きっとたぶん)人材育成や教育のような何かの話
sejima
0
680
全社統制を維持しながら現場負担をどう減らすか〜プラットフォームチームとセキュリティチームで進めたSecurity Hub活用によるAWS統制の見直し〜/secjaws-security-hub-custom-insights
mhrtech
1
270
サービスの信頼性を高めるため、形骸化した「プロダクションミーティング」を立て直すまでの取り組み
stefafafan
1
260
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.7k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
130
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
180
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The World Runs on Bad Software
bkeepers
PRO
72
12k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.4k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
540
A better future with KSS
kneath
240
18k
Designing Powerful Visuals for Engaging Learning
tmiket
1
360
How to Ace a Technical Interview
jacobian
281
24k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.3k
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