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
520
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
560
The Story of Villagers, Marbles and Oh, A Blockchain!
supriyasrivatsa
0
530
Going Multiplatform With Kotlin
supriyasrivatsa
0
630
GIDS18_SupriyaSrivatsa.pdf
supriyasrivatsa
0
500
Other Decks in Technology
See All in Technology
SnowflakeとDatabricks両方でRAGを構築してみた
kameitomohiro
1
420
白金鉱業Meetup_Vol.18_AIエージェント時代のUI/UX設計
brainpadpr
1
160
ソフトウェア開発現代史: "LeanとDevOpsの科学"の「科学」とは何か? - DORA Report 10年の変遷を追って - #DevOpsDaysTokyo
takabow
0
390
JPOUG Tech Talk #12 UNDO Tablespace Reintroduction
nori_shinoda
2
150
サーバレス、コンテナ、データベース特化型機能をご紹介。CloudWatch をもっと使いこなそう!
o11yfes2023
0
180
地味にいろいろあった! 2025春のAmazon Bedrockアップデートおさらい
minorun365
PRO
1
270
ビジネスとデザインとエンジニアリングを繋ぐために 一人のエンジニアは何ができるか / What can a single engineer do to connect business, design, and engineering?
kaminashi
0
110
YOLOv10~v12
tenten0727
4
960
AI AgentOps LT大会(2025/04/16) Algomatic伊藤発表資料
kosukeito
0
140
更新系と状態
uhyo
7
1.7k
C++26アップデート 2025-03
faithandbrave
0
670
コスト最適重視でAurora PostgreSQLのログ分析基盤を作ってみた #jawsug_tokyo
non97
0
430
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
19
1.1k
The Language of Interfaces
destraynor
157
25k
The Pragmatic Product Professional
lauravandoore
33
6.5k
Being A Developer After 40
akosma
91
590k
Faster Mobile Websites
deanohume
306
31k
4 Signs Your Business is Dying
shpigford
183
22k
How GitHub (no longer) Works
holman
314
140k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Into the Great Unknown - MozCon
thekraken
37
1.7k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
9
760
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
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