SlideShare a Scribd company logo
Tanmay Bakshi
TED Speaker, Author, Algorithm-ist
Swift for TensorFlow
Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup - June 17, 2019
Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup - June 17, 2019
First-class compiler support
for Machine Learning
Native Automatic Differentiation
1
1 + 𝑒$%
𝑤1 = 1
𝑤3 = 𝑤1 ⋅
−𝑤2
𝑤3,
𝑤5 = 𝑤3
𝑤7 = 𝑤5 ⋅ 𝑤5 ⋅ ln 𝑤6
𝑤8 = −𝑤7
Many-Language problem
C++Python
Other
Swift
PythonDockerfile
Julia
Other
Why change?
Performance & optimizations
Flexibility & Control
Rapid Prototyping
Interoperability & reverse-compatibility
Gentle learning curve
TensorFlow is fundamentally not Pythonic.
But we’re trying!
import as
10 8
3 3
10
def
return
for in 1 10000
with as
-0.1
print
import
var ref Float 10 8
var guess Float 3 3
var distance Float 10
func error Tensor Float Tensor Float Tensor Float
Tensor Float
let
return
for _ in 1 10000
let Tensor Float in
return
-0.1
Optimized for you.
Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup - June 17, 2019
It’s all in your hands.
Write code naturally,
Swift for TensorFlow takes care of the rest.
import
extension Tensor where Scalar TensorFlowFloatingPoint
func squaredError Tensor Scalar Tensor Scalar
return self
1.05x
Circle-edge finding
0.95x
MLPNN Training
Without Compiler Optimizations!
Forcibly safe code
Interoperability!
import
let np "numpy"
let p1 2 -2
let p2 10 8
func norm PythonObject PythonObject
return 2
let ex
Code time!
@TajyMany
tanmay bakshi
Tanmay Bakshi
TajyMany

More Related Content

PDF
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
PDF
Chris Fregly, Research Scientist, PipelineIO at MLconf ATL 2016
KEY
OpenMP
PPTX
Simplifying training deep and serving learning models with big data in python...
PDF
Concurrent Programming OpenMP @ Distributed System Discussion
PDF
Open mp intro_01
PPTX
ODP
OpenMp
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Chris Fregly, Research Scientist, PipelineIO at MLconf ATL 2016
OpenMP
Simplifying training deep and serving learning models with big data in python...
Concurrent Programming OpenMP @ Distributed System Discussion
Open mp intro_01
OpenMp

What's hot (20)

PPTX
Intro to OpenMP
PDF
Introduction to OpenMP
PDF
Open mp directives
PDF
Open mp
PPT
OpenMP And C++
PPTX
Presentation on Shared Memory Parallel Programming
PDF
OpenMP Tutorial for Beginners
PDF
Introduction to OpenMP
PDF
The Flow of TensorFlow
PDF
Making fitting in RooFit faster
PDF
Understanding Android Benchmarks
ODP
openmp
PDF
Asynchronous I/O in Python 3
PDF
Tensorflow on Android
PDF
Introduction to TensorFlow Lite
PDF
Introduction to Polyaxon
PDF
Numba: Array-oriented Python Compiler for NumPy
PDF
GPU Computing for Data Science
PPTX
Braxton McKee, CEO & Founder, Ufora at MLconf NYC - 4/15/16
PDF
Numba: Flexible analytics written in Python with machine-code speeds and avo...
Intro to OpenMP
Introduction to OpenMP
Open mp directives
Open mp
OpenMP And C++
Presentation on Shared Memory Parallel Programming
OpenMP Tutorial for Beginners
Introduction to OpenMP
The Flow of TensorFlow
Making fitting in RooFit faster
Understanding Android Benchmarks
openmp
Asynchronous I/O in Python 3
Tensorflow on Android
Introduction to TensorFlow Lite
Introduction to Polyaxon
Numba: Array-oriented Python Compiler for NumPy
GPU Computing for Data Science
Braxton McKee, CEO & Founder, Ufora at MLconf NYC - 4/15/16
Numba: Flexible analytics written in Python with machine-code speeds and avo...
Ad

Similar to Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup - June 17, 2019 (20)

PDF
Swift for tensorflow
PDF
Swift for tensorflow
PDF
Tensorflow 2.0 and Coral Edge TPU
PDF
Pytorch for tf_developers
PDF
Introduction To TensorFlow | Deep Learning Using TensorFlow | TensorFlow Tuto...
PDF
Introduction To TensorFlow | Deep Learning with TensorFlow | TensorFlow For B...
PDF
TensorFlow 101
PPTX
Bring your neural networks to the browser with TF.js - Simone Scardapane
PPTX
Tensorflow Ecosystem
PDF
From NumPy to PyTorch
PDF
Machine learning presentation (gdg beja)
PPTX
2017 arab wic marwa ayad machine learning
PPTX
tensorflow.pptx
PDF
Machine learning presentation (gdg beja)
PPTX
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
PDF
A Peek into TFRT
PPTX
24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmm
PDF
Memory efficient pytorch
PPTX
Tensorflow
PPTX
slide-keras-tf.pptx
Swift for tensorflow
Swift for tensorflow
Tensorflow 2.0 and Coral Edge TPU
Pytorch for tf_developers
Introduction To TensorFlow | Deep Learning Using TensorFlow | TensorFlow Tuto...
Introduction To TensorFlow | Deep Learning with TensorFlow | TensorFlow For B...
TensorFlow 101
Bring your neural networks to the browser with TF.js - Simone Scardapane
Tensorflow Ecosystem
From NumPy to PyTorch
Machine learning presentation (gdg beja)
2017 arab wic marwa ayad machine learning
tensorflow.pptx
Machine learning presentation (gdg beja)
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
A Peek into TFRT
24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmm
Memory efficient pytorch
Tensorflow
slide-keras-tf.pptx
Ad

More from Chris Fregly (20)

PDF
AWS reInvent 2022 reCap AI/ML and Data
PDF
Pandas on AWS - Let me count the ways.pdf
PDF
Ray AI Runtime (AIR) on AWS - Data Science On AWS Meetup
PDF
Smokey and the Multi-Armed Bandit Featuring BERT Reynolds Updated
PDF
Amazon reInvent 2020 Recap: AI and Machine Learning
PDF
Waking the Data Scientist at 2am: Detect Model Degradation on Production Mod...
PDF
Quantum Computing with Amazon Braket
PDF
15 Tips to Scale a Large AI/ML Workshop - Both Online and In-Person
PDF
AWS Re:Invent 2019 Re:Cap
PDF
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
PDF
Spark SQL Catalyst Optimizer, Custom Expressions, UDFs - Advanced Spark and T...
PDF
PipelineAI Continuous Machine Learning and AI - Rework Deep Learning Summit -...
PDF
PipelineAI Real-Time Machine Learning - Global Artificial Intelligence Confer...
PDF
Hyper-Parameter Tuning Across the Entire AI Pipeline GPU Tech Conference San ...
PDF
PipelineAI Optimizes Your Enterprise AI Pipeline from Distributed Training to...
PDF
Advanced Spark and TensorFlow Meetup - Dec 12 2017 - Dong Meng, MapR + Kubern...
PDF
High Performance Distributed TensorFlow in Production with GPUs - NIPS 2017 -...
PDF
PipelineAI + TensorFlow AI + Spark ML + Kuberenetes + Istio + AWS SageMaker +...
PDF
PipelineAI + AWS SageMaker + Distributed TensorFlow + AI Model Training and S...
PDF
High Performance TensorFlow in Production - Big Data Spain - Madrid - Nov 15 ...
AWS reInvent 2022 reCap AI/ML and Data
Pandas on AWS - Let me count the ways.pdf
Ray AI Runtime (AIR) on AWS - Data Science On AWS Meetup
Smokey and the Multi-Armed Bandit Featuring BERT Reynolds Updated
Amazon reInvent 2020 Recap: AI and Machine Learning
Waking the Data Scientist at 2am: Detect Model Degradation on Production Mod...
Quantum Computing with Amazon Braket
15 Tips to Scale a Large AI/ML Workshop - Both Online and In-Person
AWS Re:Invent 2019 Re:Cap
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
Spark SQL Catalyst Optimizer, Custom Expressions, UDFs - Advanced Spark and T...
PipelineAI Continuous Machine Learning and AI - Rework Deep Learning Summit -...
PipelineAI Real-Time Machine Learning - Global Artificial Intelligence Confer...
Hyper-Parameter Tuning Across the Entire AI Pipeline GPU Tech Conference San ...
PipelineAI Optimizes Your Enterprise AI Pipeline from Distributed Training to...
Advanced Spark and TensorFlow Meetup - Dec 12 2017 - Dong Meng, MapR + Kubern...
High Performance Distributed TensorFlow in Production with GPUs - NIPS 2017 -...
PipelineAI + TensorFlow AI + Spark ML + Kuberenetes + Istio + AWS SageMaker +...
PipelineAI + AWS SageMaker + Distributed TensorFlow + AI Model Training and S...
High Performance TensorFlow in Production - Big Data Spain - Madrid - Nov 15 ...

Recently uploaded (20)

PDF
System and Network Administration Chapter 2
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
System and Network Administraation Chapter 3
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Online Work Permit System for Fast Permit Processing
PPTX
L1 - Introduction to python Backend.pptx
PDF
Digital Strategies for Manufacturing Companies
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
medical staffing services at VALiNTRY
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
top salesforce developer skills in 2025.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
How Creative Agencies Leverage Project Management Software.pdf
System and Network Administration Chapter 2
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
System and Network Administraation Chapter 3
CHAPTER 2 - PM Management and IT Context
Online Work Permit System for Fast Permit Processing
L1 - Introduction to python Backend.pptx
Digital Strategies for Manufacturing Companies
How to Choose the Right IT Partner for Your Business in Malaysia
medical staffing services at VALiNTRY
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
2025 Textile ERP Trends: SAP, Odoo & Oracle
top salesforce developer skills in 2025.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Upgrade and Innovation Strategies for SAP ERP Customers
Design an Analysis of Algorithms II-SECS-1021-03
How Creative Agencies Leverage Project Management Software.pdf

Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup - June 17, 2019