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
610
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
650
The Story of Villagers, Marbles and Oh, A Blockchain!
supriyasrivatsa
0
620
Going Multiplatform With Kotlin
supriyasrivatsa
0
720
GIDS18_SupriyaSrivatsa.pdf
supriyasrivatsa
0
590
Other Decks in Technology
See All in Technology
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
210
Webhook best practices for rock solid and resilient deployments
glaforge
1
290
レガシー共有バッチ基盤への挑戦 - SREドリブンなリアーキテクチャリングの取り組み
tatsukoni
0
220
クレジットカード決済基盤を支えるSRE - 厳格な監査とSRE運用の両立 (SRE Kaigi 2026)
capytan
6
2.8k
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.5k
Tebiki Engineering Team Deck
tebiki
0
24k
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
620
AI駆動PjMの理想像 と現在地 -実践例を添えて-
masahiro_okamura
1
110
What happened to RubyGems and what can we learn?
mikemcquaid
0
300
AWS Network Firewall Proxyを触ってみた
nagisa53
1
230
Featured
See All Featured
Mind Mapping
helmedeiros
PRO
0
87
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
260
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
94
We Have a Design System, Now What?
morganepeng
54
8k
KATA
mclloyd
PRO
34
15k
The Limits of Empathy - UXLibs8
cassininazir
1
210
A Soul's Torment
seathinner
5
2.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
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