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
0
500
Mobile, AI and TensorFlow
Supriya Srivatsa
October 05, 2017
Tweet
Share
More Decks by Supriya Srivatsa
See All by Supriya Srivatsa
Forgotten Histories
supriyasrivatsa
0
540
The Story of Villagers, Marbles and Oh, A Blockchain!
supriyasrivatsa
0
520
Going Multiplatform With Kotlin
supriyasrivatsa
0
620
GIDS18_SupriyaSrivatsa.pdf
supriyasrivatsa
0
490
Other Decks in Technology
See All in Technology
滅・サービスクラス🔥 / Destruction Service Class
sinsoku
6
1.5k
Datadog APM におけるトレース収集の流れ及び Retention Filters のはなし / datadog-apm-trace-retention-filters
k6s4i53rx
0
300
BLEAでAWSアカウントのセキュリティレベルを向上させよう
koheiyoshikawa
0
190
Moved to https://speakerdeck.com/toshihue/presales-engineer-career-bridging-tech-biz-ja
toshihue
2
120
APIファーストで実現する運用性の高い IoT プラットフォーム: SORACOMのアプローチ
soracom
PRO
0
220
組織貢献をするフリーランスエンジニアという生き方
n_takehata
1
370
Developer Summit 2025 [14-D-1] Yuki Hattori
yuhattor
17
3.5k
5分で紹介する生成AIエージェントとAmazon Bedrock Agents / 5-minutes introduction to generative AI agents and Amazon Bedrock Agents
hideakiaoyagi
0
200
データの品質が低いと何が困るのか
kzykmyzw
6
980
WAF に頼りすぎない AWS WAF 運用術 meguro sec #1
izzii
0
460
「海外登壇」という 選択肢を与えるために 〜Gophers EX
logica0419
0
110
Kubernetesでメールの大量配信をしている話/k8sjp-20250205
hfukamachi
0
380
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Documentation Writing (for coders)
carmenintech
67
4.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
540
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
20
2.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
9
1.3k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
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