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
430
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
470
The Story of Villagers, Marbles and Oh, A Blockchain!
supriyasrivatsa
0
460
Going Multiplatform With Kotlin
supriyasrivatsa
0
540
GIDS18_SupriyaSrivatsa.pdf
supriyasrivatsa
0
420
Other Decks in Technology
See All in Technology
MapLibreとAmazon Location Service
dayjournal
1
150
Kernel MemoryでAzure OpenAI Serviceとお手軽データソース連携
mitsuzono
1
240
元インフラエンジニアに成る / Human Resources to Human Relations
bobtani
4
910
GraphQL 成熟度モデルの紹介と、プロダクトに当てはめた事例 / GraphQL maturity model
mh4gf
7
1.3k
SIEMを用いて、セキュリティログ分析の可視化と分析を実現し、PDCAサイクルを回してみた
coconala_engineer
0
280
Postman v10リリース後を振り返る / Looking back at Postman v10 after release
yokawasa
1
160
Vertex AI を中心に 生成AIのアップデートを共有します
kaz1437
0
300
推しは推せるときに推せ! プロダクトにフィードバックしていこう
nakasho
0
300
20240416_devopsdaystokyo
kzkmaeda
1
220
VS CodeでAWSを操作しよう
smt7174
7
1.6k
Cloud Native Java with Spring Boot (CNCF Aarhus, April 2024)
thomasvitale
1
170
ユーザーストーリーのレビューを自動化したみたの
bun913
1
420
Featured
See All Featured
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
322
20k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
121
39k
Code Review Best Practice
trishagee
55
15k
Being A Developer After 40
akosma
57
580k
How to train your dragon (web standard)
notwaldorf
73
5.2k
A better future with KSS
kneath
231
16k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
Automating Front-end Workflow
addyosmani
1356
200k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
30
6k
Fantastic passwords and where to find them - at NoRuKo
philnash
37
2.5k
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