SlideShare a Scribd company logo
© 2017 MapR TechnologiesMapR Confidential 1
Tensor Abuse
In the Workplace
© 2017 MapR TechnologiesMapR Confidential 2
Agenda
• What are tensors?
• How modern tensor systems work
• It's not just machine learning
• It’s also not magic
• Machine learning as optimization
• Animation of optimization algorithm
© 2017 MapR TechnologiesMapR Confidential 3
Spoilers
• Trigger warning: Greek letters ahead
– AND lots of animations for developing intuitions
• Tensors have a history in physics
• We don’t use them that way in machine learning
• Tensors are cool because they make it easier to code
numerical algorithms
• But auto-derivatives are as big a deal
• And we can abuse this machinery
© 2017 MapR TechnologiesMapR Confidential 4
Linear Operators on To the N-th Degree
• Tensors were originally invented for differential geometry
• That gave us relativity
© 2017 MapR TechnologiesMapR Confidential 5
But This Isn’t Physics
• In computing, we use some of the same words
• But they don’t mean the same thing
• We don’t need the Greek letters
• The point is that we have important patterns of computation
– We mostly don’t care about changing coordinate systems
© 2017 MapR TechnologiesMapR Confidential 6
Basic Operations
• Element-wise operations
• Outer products
• Reductions
• Matrix and vector products are special cases
© 2017 MapR TechnologiesMapR Confidential 7
This is news?!?
© 2017 MapR TechnologiesMapR Confidential 8
This is news?!?
Sounds like APL in sheep’s clothing
© 2017 MapR TechnologiesMapR Confidential 9
But it really is important
because
loop structuring is critical
© 2017 MapR TechnologiesMapR Confidential 10
Why This Matters for Machine Learning
• Sums of products and element-wise evaluations are ubiquitous
in machine learning
• And this is often surrounded by an outer loop
• This is susceptible to pipelining in GPU’s, but only if you can
see the large-scale patterns in the code
© 2017 MapR TechnologiesMapR Confidential 11
But, tensors are only
half of the story
© 2017 MapR TechnologiesMapR Confidential 12
Machine Learning Has Changed
• Machine learning used to be really hard
– Numeric performance was zilch
– Training data was poor and small
– Learning many layers of a MLP was impossible
– Productivity for new approaches hampered by code complexity
• Recent advances have changed things (a lot)
– Important new regularization techniques
– Per coefficient learning rate techniques
– New gradient based optimization algorithms
– Automated differentiation
© 2017 MapR TechnologiesMapR Confidential 13
© 2017 MapR TechnologiesMapR Confidential 14
© 2017 MapR TechnologiesMapR Confidential 15
© 2017 MapR TechnologiesMapR Confidential 17
Gradients are a Big Deal
• In low dimensions, simple search techniques work well
– Line search, evolutionary processes, polyhedron warping all work
• It’s different in high dimensions
– Need some guide about which direction to go
– Too many ways to get sideways
© 2017 MapR TechnologiesMapR Confidential 18
© 2017 MapR TechnologiesMapR Confidential 19
© 2017 MapR TechnologiesMapR Confidential 20
Yeah, But …
• Gradients are also a pain in the ***
– Traditionally you needed to derive them by hand
– For some problems like robot kinematics or astrodynamics, equations
would cover many pages
• The big change in recent years is automatic differentiation
– Some limits on how problems are formulated
– But pretty complicated forms can be allowed easily
© 2017 MapR TechnologiesMapR Confidential 21
© 2017 MapR TechnologiesMapR Confidential 22
© 2017 MapR TechnologiesMapR Confidential 23
hidden = tf.nn.elu(x - biases)
y_pred = tf.matmul(hidden, weights)
loss = tf.reduce_mean((y - y_pred) ** 2)
© 2017 MapR TechnologiesMapR Confidential 24
The Lessons to Learn
• These new systems are astounding
– Tensors allow us to encode very complex algorithms
– Auto-differentiation allows us to use gradients
– New optimizers solve very nasty problems
– The same code can drive CPU, GPU or clusters
– The code is strange and abstract, but not that hard
• Not just for breakfast any more
– Machine learning isn’t the only thing you can do with these systems
– Go for it!
© 2017 MapR TechnologiesMapR Confidential 25
Q&A
@mapr
maprtechnologies
yourname@mapr.com
ENGAGE WITH US

More Related Content

What's hot (20)

PPTX
Machine Learning for Chickens, Autonomous Driving and a 3-year-old Who Won’t ...
MapR Technologies
 
PPTX
How to tell which algorithms really matter
DataWorks Summit
 
PPTX
Cognitive computing with big data, high tech and low tech approaches
Ted Dunning
 
PDF
Streaming Goes Mainstream: New Architecture & Emerging Technologies for Strea...
MapR Technologies
 
PPTX
Sharing Sensitive Data Securely
Ted Dunning
 
PPTX
Hadoop and R Go to the Movies
DataWorks Summit
 
PPTX
What is the past future tense of data?
Ted Dunning
 
PPTX
Doing-the-impossible
Ted Dunning
 
PPTX
Anomaly Detection - New York Machine Learning
Ted Dunning
 
PPTX
Dunning time-series-2015
Ted Dunning
 
PPTX
Possible Visions for Mahout 1.0
Ted Dunning
 
PPTX
Which Algorithms Really Matter
Ted Dunning
 
PPTX
MapR and Machine Learning Primer
Mathieu Dumoulin
 
PPTX
Dunning ml-conf-2014
MapR Technologies
 
PDF
Strata 2014 Anomaly Detection
Ted Dunning
 
PDF
Streaming patterns revolutionary architectures
Carol McDonald
 
PDF
Mathematical bridges From Old to New
MapR Technologies
 
PPTX
What's new in Apache Mahout
Ted Dunning
 
PPTX
My talk about recommendation and search to the Hive
Ted Dunning
 
PPTX
R + Storm Moneyball - Realtime Advanced Statistics - Hadoop Summit - San Jose
Allen Day, PhD
 
Machine Learning for Chickens, Autonomous Driving and a 3-year-old Who Won’t ...
MapR Technologies
 
How to tell which algorithms really matter
DataWorks Summit
 
Cognitive computing with big data, high tech and low tech approaches
Ted Dunning
 
Streaming Goes Mainstream: New Architecture & Emerging Technologies for Strea...
MapR Technologies
 
Sharing Sensitive Data Securely
Ted Dunning
 
Hadoop and R Go to the Movies
DataWorks Summit
 
What is the past future tense of data?
Ted Dunning
 
Doing-the-impossible
Ted Dunning
 
Anomaly Detection - New York Machine Learning
Ted Dunning
 
Dunning time-series-2015
Ted Dunning
 
Possible Visions for Mahout 1.0
Ted Dunning
 
Which Algorithms Really Matter
Ted Dunning
 
MapR and Machine Learning Primer
Mathieu Dumoulin
 
Dunning ml-conf-2014
MapR Technologies
 
Strata 2014 Anomaly Detection
Ted Dunning
 
Streaming patterns revolutionary architectures
Carol McDonald
 
Mathematical bridges From Old to New
MapR Technologies
 
What's new in Apache Mahout
Ted Dunning
 
My talk about recommendation and search to the Hive
Ted Dunning
 
R + Storm Moneyball - Realtime Advanced Statistics - Hadoop Summit - San Jose
Allen Day, PhD
 

Similar to Tensor Abuse - how to reuse machine learning frameworks (20)

PDF
Using TensorFlow for Machine Learning
Justin Brandenburg
 
PPTX
tensorflow.pptx
JoanJeremiah
 
PPTX
1. Introduction to deep learning.pptx
Omer Tariq
 
PDF
IRJET - Application of Linear Algebra in Machine Learning
IRJET Journal
 
PDF
Python Machine Learning - Getting Started
Rafey Iqbal Rahman
 
PPTX
Quantum machine learning basics
Krishna Kumar Sekar
 
PDF
Machine learning the next revolution or just another hype
Jorge Ferrer
 
PDF
Forget about AI and do Mathematical Modelling instead!
Florian Wilhelm
 
PPTX
Deep Learning for Fraud Detection
DataWorks Summit/Hadoop Summit
 
PDF
Deep Learning and Automatic Differentiation from Theano to PyTorch
inside-BigData.com
 
PPTX
Introduction to Machine Learning basics.pptx
srimathihss
 
PPTX
Recent Advances in Machine Learning: Bringing a New Level of Intelligence to ...
Brocade
 
PPTX
AD3501 - DL Unit-1 PPT.pptx python syllabus
kumaresan7751
 
PDF
Big Data & Machine Learning
Angelo Mariano
 
PPTX
1. Introduction to deep learning.pptx
Kv Sagar
 
PPT
Machine learning-in-details-with-out-python-code
Osama Ghandour Geris
 
PPTX
Deep learning with tensorflow
Charmi Chokshi
 
PPTX
TensorFlow.pptx
Jayesh Patil
 
PDF
Mathematical artificial intelligence
LikithaK8
 
PDF
Begin with Machine Learning
Narong Intiruk
 
Using TensorFlow for Machine Learning
Justin Brandenburg
 
tensorflow.pptx
JoanJeremiah
 
1. Introduction to deep learning.pptx
Omer Tariq
 
IRJET - Application of Linear Algebra in Machine Learning
IRJET Journal
 
Python Machine Learning - Getting Started
Rafey Iqbal Rahman
 
Quantum machine learning basics
Krishna Kumar Sekar
 
Machine learning the next revolution or just another hype
Jorge Ferrer
 
Forget about AI and do Mathematical Modelling instead!
Florian Wilhelm
 
Deep Learning for Fraud Detection
DataWorks Summit/Hadoop Summit
 
Deep Learning and Automatic Differentiation from Theano to PyTorch
inside-BigData.com
 
Introduction to Machine Learning basics.pptx
srimathihss
 
Recent Advances in Machine Learning: Bringing a New Level of Intelligence to ...
Brocade
 
AD3501 - DL Unit-1 PPT.pptx python syllabus
kumaresan7751
 
Big Data & Machine Learning
Angelo Mariano
 
1. Introduction to deep learning.pptx
Kv Sagar
 
Machine learning-in-details-with-out-python-code
Osama Ghandour Geris
 
Deep learning with tensorflow
Charmi Chokshi
 
TensorFlow.pptx
Jayesh Patil
 
Mathematical artificial intelligence
LikithaK8
 
Begin with Machine Learning
Narong Intiruk
 
Ad

More from Ted Dunning (11)

PPTX
Dunning - SIGMOD - Data Economy.pptx
Ted Dunning
 
PPTX
How to Get Going with Kubernetes
Ted Dunning
 
PPTX
Progress for big data in Kubernetes
Ted Dunning
 
PPTX
Anomaly Detection: How to find what you didn’t know to look for
Ted Dunning
 
PPTX
Machine Learning Logistics
Ted Dunning
 
PPTX
How the Internet of Things is Turning the Internet Upside Down
Ted Dunning
 
PPTX
Apache Kylin - OLAP Cubes for SQL on Hadoop
Ted Dunning
 
PPTX
Recommendation Techn
Ted Dunning
 
PPTX
Building multi-modal recommendation engines using search engines
Ted Dunning
 
PPTX
Using Mahout and a Search Engine for Recommendation
Ted Dunning
 
PPTX
Inside MapR's M7
Ted Dunning
 
Dunning - SIGMOD - Data Economy.pptx
Ted Dunning
 
How to Get Going with Kubernetes
Ted Dunning
 
Progress for big data in Kubernetes
Ted Dunning
 
Anomaly Detection: How to find what you didn’t know to look for
Ted Dunning
 
Machine Learning Logistics
Ted Dunning
 
How the Internet of Things is Turning the Internet Upside Down
Ted Dunning
 
Apache Kylin - OLAP Cubes for SQL on Hadoop
Ted Dunning
 
Recommendation Techn
Ted Dunning
 
Building multi-modal recommendation engines using search engines
Ted Dunning
 
Using Mahout and a Search Engine for Recommendation
Ted Dunning
 
Inside MapR's M7
Ted Dunning
 
Ad

Recently uploaded (20)

PPTX
Presentation1.pptx4327r58465824358432884
udayfand0306
 
DOCX
AI/ML Applications in Financial domain projects
Rituparna De
 
PDF
apidays Munich 2025 - Automating Operations Without Reinventing the Wheel, Ma...
apidays
 
PPTX
apidays Munich 2025 - Effectively incorporating API Security into the overall...
apidays
 
PPTX
Spark with anjbnn hfkkjn hbkjbu h jhbk.pptx
nreddyjanga
 
PPTX
Lecture_9_EPROM_Flash univeristy lecture fall 2022
ssuser5047c5
 
PPT
Data base management system Transactions.ppt
gandhamcharan2006
 
PDF
How to Avoid 7 Costly Mainframe Migration Mistakes
JP Infra Pvt Ltd
 
PDF
List of all the AI prompt cheat codes.pdf
Avijit Kumar Roy
 
PPT
Lecture 2-1.ppt at a higher learning institution such as the university of Za...
rachealhantukumane52
 
PPT
1 DATALINK CONTROL and it's applications
karunanidhilithesh
 
PPTX
apidays Munich 2025 - Federated API Management and Governance, Vince Baker (D...
apidays
 
PPTX
Learning Tendency Analysis of Scratch Programming Course(Entry Class) for Upp...
ryouta039
 
PDF
Introduction to Data Science_Washington_
StarToon1
 
PDF
Web Scraping with Google Gemini 2.0 .pdf
Tamanna
 
PDF
Building Production-Ready AI Agents with LangGraph.pdf
Tamanna
 
PPTX
Introduction to Artificial Intelligence.pptx
StarToon1
 
PPTX
AI Project Cycle and Ethical Frameworks.pptx
RiddhimaVarshney1
 
PPTX
apidays Munich 2025 - GraphQL 101: I won't REST, until you GraphQL, Surbhi Si...
apidays
 
PPTX
Resmed Rady Landis May 4th - analytics.pptx
Adrian Limanto
 
Presentation1.pptx4327r58465824358432884
udayfand0306
 
AI/ML Applications in Financial domain projects
Rituparna De
 
apidays Munich 2025 - Automating Operations Without Reinventing the Wheel, Ma...
apidays
 
apidays Munich 2025 - Effectively incorporating API Security into the overall...
apidays
 
Spark with anjbnn hfkkjn hbkjbu h jhbk.pptx
nreddyjanga
 
Lecture_9_EPROM_Flash univeristy lecture fall 2022
ssuser5047c5
 
Data base management system Transactions.ppt
gandhamcharan2006
 
How to Avoid 7 Costly Mainframe Migration Mistakes
JP Infra Pvt Ltd
 
List of all the AI prompt cheat codes.pdf
Avijit Kumar Roy
 
Lecture 2-1.ppt at a higher learning institution such as the university of Za...
rachealhantukumane52
 
1 DATALINK CONTROL and it's applications
karunanidhilithesh
 
apidays Munich 2025 - Federated API Management and Governance, Vince Baker (D...
apidays
 
Learning Tendency Analysis of Scratch Programming Course(Entry Class) for Upp...
ryouta039
 
Introduction to Data Science_Washington_
StarToon1
 
Web Scraping with Google Gemini 2.0 .pdf
Tamanna
 
Building Production-Ready AI Agents with LangGraph.pdf
Tamanna
 
Introduction to Artificial Intelligence.pptx
StarToon1
 
AI Project Cycle and Ethical Frameworks.pptx
RiddhimaVarshney1
 
apidays Munich 2025 - GraphQL 101: I won't REST, until you GraphQL, Surbhi Si...
apidays
 
Resmed Rady Landis May 4th - analytics.pptx
Adrian Limanto
 

Tensor Abuse - how to reuse machine learning frameworks

  • 1. © 2017 MapR TechnologiesMapR Confidential 1 Tensor Abuse In the Workplace
  • 2. © 2017 MapR TechnologiesMapR Confidential 2 Agenda • What are tensors? • How modern tensor systems work • It's not just machine learning • It’s also not magic • Machine learning as optimization • Animation of optimization algorithm
  • 3. © 2017 MapR TechnologiesMapR Confidential 3 Spoilers • Trigger warning: Greek letters ahead – AND lots of animations for developing intuitions • Tensors have a history in physics • We don’t use them that way in machine learning • Tensors are cool because they make it easier to code numerical algorithms • But auto-derivatives are as big a deal • And we can abuse this machinery
  • 4. © 2017 MapR TechnologiesMapR Confidential 4 Linear Operators on To the N-th Degree • Tensors were originally invented for differential geometry • That gave us relativity
  • 5. © 2017 MapR TechnologiesMapR Confidential 5 But This Isn’t Physics • In computing, we use some of the same words • But they don’t mean the same thing • We don’t need the Greek letters • The point is that we have important patterns of computation – We mostly don’t care about changing coordinate systems
  • 6. © 2017 MapR TechnologiesMapR Confidential 6 Basic Operations • Element-wise operations • Outer products • Reductions • Matrix and vector products are special cases
  • 7. © 2017 MapR TechnologiesMapR Confidential 7 This is news?!?
  • 8. © 2017 MapR TechnologiesMapR Confidential 8 This is news?!? Sounds like APL in sheep’s clothing
  • 9. © 2017 MapR TechnologiesMapR Confidential 9 But it really is important because loop structuring is critical
  • 10. © 2017 MapR TechnologiesMapR Confidential 10 Why This Matters for Machine Learning • Sums of products and element-wise evaluations are ubiquitous in machine learning • And this is often surrounded by an outer loop • This is susceptible to pipelining in GPU’s, but only if you can see the large-scale patterns in the code
  • 11. © 2017 MapR TechnologiesMapR Confidential 11 But, tensors are only half of the story
  • 12. © 2017 MapR TechnologiesMapR Confidential 12 Machine Learning Has Changed • Machine learning used to be really hard – Numeric performance was zilch – Training data was poor and small – Learning many layers of a MLP was impossible – Productivity for new approaches hampered by code complexity • Recent advances have changed things (a lot) – Important new regularization techniques – Per coefficient learning rate techniques – New gradient based optimization algorithms – Automated differentiation
  • 13. © 2017 MapR TechnologiesMapR Confidential 13
  • 14. © 2017 MapR TechnologiesMapR Confidential 14
  • 15. © 2017 MapR TechnologiesMapR Confidential 15
  • 16. © 2017 MapR TechnologiesMapR Confidential 17 Gradients are a Big Deal • In low dimensions, simple search techniques work well – Line search, evolutionary processes, polyhedron warping all work • It’s different in high dimensions – Need some guide about which direction to go – Too many ways to get sideways
  • 17. © 2017 MapR TechnologiesMapR Confidential 18
  • 18. © 2017 MapR TechnologiesMapR Confidential 19
  • 19. © 2017 MapR TechnologiesMapR Confidential 20 Yeah, But … • Gradients are also a pain in the *** – Traditionally you needed to derive them by hand – For some problems like robot kinematics or astrodynamics, equations would cover many pages • The big change in recent years is automatic differentiation – Some limits on how problems are formulated – But pretty complicated forms can be allowed easily
  • 20. © 2017 MapR TechnologiesMapR Confidential 21
  • 21. © 2017 MapR TechnologiesMapR Confidential 22
  • 22. © 2017 MapR TechnologiesMapR Confidential 23 hidden = tf.nn.elu(x - biases) y_pred = tf.matmul(hidden, weights) loss = tf.reduce_mean((y - y_pred) ** 2)
  • 23. © 2017 MapR TechnologiesMapR Confidential 24 The Lessons to Learn • These new systems are astounding – Tensors allow us to encode very complex algorithms – Auto-differentiation allows us to use gradients – New optimizers solve very nasty problems – The same code can drive CPU, GPU or clusters – The code is strange and abstract, but not that hard • Not just for breakfast any more – Machine learning isn’t the only thing you can do with these systems – Go for it!
  • 24. © 2017 MapR TechnologiesMapR Confidential 25 Q&A @mapr maprtechnologies [email protected] ENGAGE WITH US