Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Mobile, AI and TensorFlow
Search
Supriya Srivatsa
October 05, 2017
Technology
640
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Mobile, AI and TensorFlow
Supriya Srivatsa
October 05, 2017
More Decks by Supriya Srivatsa
See All by Supriya Srivatsa
Forgotten Histories
supriyasrivatsa
0
670
The Story of Villagers, Marbles and Oh, A Blockchain!
supriyasrivatsa
0
660
Going Multiplatform With Kotlin
supriyasrivatsa
0
740
GIDS18_SupriyaSrivatsa.pdf
supriyasrivatsa
0
620
Other Decks in Technology
See All in Technology
Running Kotlin + Quarkus with Lambda
nealle
0
380
AI時代のPRレビューにどう向き合うか?
kairim0
1
160
並行性の問題を防げ!実践トランザクション入門
occhi
0
280
分析の民主化を支えるメタデータ整備の実践
kakehashi
PRO
4
1.2k
AI時代に必要な脅威モデリング― 変化の速度に負けない理解とリスク判断
masakane55
5
1.2k
宣言型部分更新は何を解決しどこへ向かうのか
shuta13
0
300
オブザーバビリティを高める AI エージェント体験を考える / Designing AI Agent Experiences That Enhance Observability
aoto
PRO
2
330
味覇で作るパスタが美味い - 20261001_yabaubuki.dev
livesense
PRO
0
120
V8のArray.prototype.flatを最大約20倍速くするまでと、巨大OSSへの大規模コミットの道のり
riyaamemiya
0
180
継続的なAIコスト最適化
bgpat
1
280
初対面のメンバーがチームを組み、Claude Codeでゼロからサービスをリリース
mkdev10
1
120
Incremental HTTP
kazuho
5
2.1k
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
300
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Between Models and Reality
mayunak
4
490
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
580
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
370
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
360
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
790
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
320
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
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