SlideShare a Scribd company logo
The TensorFlow dance
craze
Gabe Hamilton
TensorFlow is a
Machine Learning library
What is Machine Learning?
usually: Statistical Pattern Matching
Using past measurements to predict something
about a new piece of information
Does this picture contain a cat? Classification
How much is this home worth? Regression
Regression Talk
https://docs.google.com/presentation/d/17FoojZ17DKDZqoByhB16PmtAXtnJ
tXSy1-feK9-A_fg/edit#slide=id.p10
There are lots of other ML libraries
Is it right for you?
Maybe Not, use Prediction API
http://www.slideshare.net/gabehamilton/intro-to-google-prediction-api-15167420
Or equivalent Amazon or Microsoft APIs
if you have a CSV of observed data.
But I’d like to get into the
details or I am working on
a complex problem...
You do still have some
choices.
Some people prefer Keras on top of TensorFlow
https://keras.io/ or tf-slim or pretty-tensor
So why use TensorFlow?
It’s not much different than the “easier” libraries.
You’ll want to understand more and more details anyway.
Because you like
It has the hottest dance moves!
Look out a Tensor!
Some Math and a Multi-Dimensional Array had a baby
For our purposes
It’s a multi-dimensional array.
Just remember that you are
putting a mathematical construct
in that array.
A tensor is a multi-dimensional
array with certain transformation
properties
You have some data
Even though it’s in a 2D spreadsheet it can
describe a multidimensional space.
House Price Data
1 mile to park
2 bedrooms
1800 sq ft
So our Tensor is [1, 2, 1800]Square footage
Distance to park
# of bathrooms
Let’s build a Tensor Machine
= a Tensor
Comparing output
is our Output
But we are expecting
- = Loss
Iterate until we have a good model
Demo
Simple Regression
https://github.com/gabehamilton/code-from-talks/tree/master/tensorflow_intro
Demo
(run in Datalab)
Demo code: fitting a line to points
Demo is of Datalab notebook
# Create 100 phony x, y data points in NumPy, y = x * 0.1 + 0.3
tf.reset_default_graph()
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
x_measured = np.random.rand(100).astype(np.float32)
y_measured = x_measured * (0.1 + (0.05 *np.random.rand(100))) + 0.3
plt.scatter(x_measured, y_measured)
plt.xlabel('<- Bluer : Uniform Color : Redder ->')
plt.ylabel('Deaths per mission')
plt.title('Star Trek Uniform Color Mortality Incidence')
# plt.plot([0, 1], [0, 0.5], color='purple', lw=2)
# plt.plot([0, 1], [0.25, 0.5], color='purple', lw=2)
Measured Data
Demo code continued
import tensorflow as tf
# Try to find values for slope and offset that match
# y_measured = slope * x_measured + offset
slope = tf.Variable(tf.random_uniform([1], -1.0, 1.0))
offset = tf.Variable(tf.zeros([1]))
y_predicted = slope * x_measured + offset
loss = tf.reduce_mean(tf.square(y_predicted - y_measured))
optimizer = tf.train.GradientDescentOptimizer(0.5)
train = optimizer.minimize(loss)
A test value for slope
Demo code continued
# Launch the graph.
sess = tf.Session()
sess.run(tf.initialize_all_variables()) # and initialize variables
# Fit the line.
print 'step #t', 'slopett', 'offset'
for step in range(201):
sess.run(train)
if step % 20 == 0:
print step,'t', sess.run(slope)[0], 't', sess.run(offset)[0]
A test value for slope and offset
Q & A
Plus more slides for longer talks or
answering questions
Why TensorFlow is useful
Build your graph in a high level language,
execute in fast implementations.
Distribute graph operations across processors.
Whole graph can be optimized.
4+ D Spaces
A given measurement all fits into a simple Tensor: [4, 4, 4, 3]
Some Tensors
Scalar 0.2
Vector [1, 2, 1800]
Matrix
[2, 1, 1],
[1, 2, 0],
[0, 1, 0]
n-Tensors
Rank 2 Tensor
When a bunch of
vectors hang out
they make a Matrix
[2, 1, 1],
[1, 2, 0],
[0, 1, 0]

More Related Content

PDF
Use the Matplotlib, Luke @ PyCon Taiwan 2012
PDF
Class 8b: Numpy & Matplotlib
PPTX
Introduction to matplotlib
PPT
Dynamic allocation
PDF
Theano vs TensorFlow | Edureka
PDF
matplotlib-installatin-interactive-contour-example-guide
PDF
Introduction to NumPy (PyData SV 2013)
PDF
Your first TensorFlow programming with Jupyter
Use the Matplotlib, Luke @ PyCon Taiwan 2012
Class 8b: Numpy & Matplotlib
Introduction to matplotlib
Dynamic allocation
Theano vs TensorFlow | Edureka
matplotlib-installatin-interactive-contour-example-guide
Introduction to NumPy (PyData SV 2013)
Your first TensorFlow programming with Jupyter

What's hot (20)

PDF
Matplotlib 簡介與使用
PDF
The matplotlib Library
PPTX
Tensorflow windows installation
KEY
NumPy/SciPy Statistics
PDF
Py lecture5 python plots
PDF
Effective Numerical Computation in NumPy and SciPy
PDF
Gnuplot 2
PPTX
U3.stack queue
PPTX
Project gnuplot
PDF
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
PDF
機械学習によるデータ分析 実践編
PPTX
Python Scipy Numpy
PPTX
Introduction to Pylab and Matploitlib.
PPTX
Data Structures - Lecture 6 [queues]
PPTX
Malloc() and calloc() in c
PPT
computer notes - Data Structures - 8
PDF
Introduction to Iteratees (Scala)
PPTX
Memory management CP
PDF
Matplotlib demo code
Matplotlib 簡介與使用
The matplotlib Library
Tensorflow windows installation
NumPy/SciPy Statistics
Py lecture5 python plots
Effective Numerical Computation in NumPy and SciPy
Gnuplot 2
U3.stack queue
Project gnuplot
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
機械学習によるデータ分析 実践編
Python Scipy Numpy
Introduction to Pylab and Matploitlib.
Data Structures - Lecture 6 [queues]
Malloc() and calloc() in c
computer notes - Data Structures - 8
Introduction to Iteratees (Scala)
Memory management CP
Matplotlib demo code
Ad

Similar to The TensorFlow dance craze (20)

PPTX
Machine Learning - Introduction to Tensorflow
PPTX
Introduction to Tensorflow
PDF
Google TensorFlow Tutorial
PPTX
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
PPTX
Bring your neural networks to the browser with TF.js - Simone Scardapane
PDF
Tensor flow description of ML Lab. document
PPTX
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
PPTX
TensorFlow for IITians
PDF
Introducton to Convolutional Nerural Network with TensorFlow
PPTX
Introduction to Deep Learning and TensorFlow
PDF
maXbox starter65 machinelearning3
PPTX
Deep Learning, Scala, and Spark
PPTX
Deep Learning, Keras, and TensorFlow
PPTX
H2 o berkeleydltf
PPTX
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
PPTX
Intro to Deep Learning, TensorFlow, and tensorflow.js
PDF
Gentlest Introduction to Tensorflow - Part 2
PPTX
Introduction to Neural Networks and Deep Learning from Scratch
PDF
What is TensorFlow and why do we use it
PPTX
TensorFlow in Your Browser
Machine Learning - Introduction to Tensorflow
Introduction to Tensorflow
Google TensorFlow Tutorial
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
Bring your neural networks to the browser with TF.js - Simone Scardapane
Tensor flow description of ML Lab. document
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow for IITians
Introducton to Convolutional Nerural Network with TensorFlow
Introduction to Deep Learning and TensorFlow
maXbox starter65 machinelearning3
Deep Learning, Scala, and Spark
Deep Learning, Keras, and TensorFlow
H2 o berkeleydltf
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
Intro to Deep Learning, TensorFlow, and tensorflow.js
Gentlest Introduction to Tensorflow - Part 2
Introduction to Neural Networks and Deep Learning from Scratch
What is TensorFlow and why do we use it
TensorFlow in Your Browser
Ad

More from Gabriel Hamilton (15)

PDF
Javascript Smart Contracts on NEAR
PDF
Smart Contracts
PDF
PDF
Beyond Agile Software
PPTX
Natural language processing: feature extraction
PDF
Software engineering for CEOs
PDF
Adaptive software engineering
PPTX
DataFlow & Beam
PDF
Software engineering for CEOs ch1
PDF
DOSUG Intro to google prediction api
PDF
How BigQuery broke my heart
PDF
How to present lots of information on a screen
PDF
Intro to Google Prediction API
ODP
Dojo: Beautiful Web Apps, Fast
ODP
Dojo: Getting Started Today
Javascript Smart Contracts on NEAR
Smart Contracts
Beyond Agile Software
Natural language processing: feature extraction
Software engineering for CEOs
Adaptive software engineering
DataFlow & Beam
Software engineering for CEOs ch1
DOSUG Intro to google prediction api
How BigQuery broke my heart
How to present lots of information on a screen
Intro to Google Prediction API
Dojo: Beautiful Web Apps, Fast
Dojo: Getting Started Today

Recently uploaded (20)

PDF
Design an Analysis of Algorithms II-SECS-1021-03
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PDF
Complete Guide to Website Development in Malaysia for SMEs
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
Download FL Studio Crack Latest version 2025 ?
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
assetexplorer- product-overview - presentation
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Cost to Outsource Software Development in 2025
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Design an Analysis of Algorithms II-SECS-1021-03
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
Complete Guide to Website Development in Malaysia for SMEs
Monitoring Stack: Grafana, Loki & Promtail
Download FL Studio Crack Latest version 2025 ?
Wondershare Filmora 15 Crack With Activation Key [2025
Design an Analysis of Algorithms I-SECS-1021-03
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Designing Intelligence for the Shop Floor.pdf
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
wealthsignaloriginal-com-DS-text-... (1).pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Computer Software and OS of computer science of grade 11.pptx
assetexplorer- product-overview - presentation
iTop VPN Crack Latest Version Full Key 2025
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Navsoft: AI-Powered Business Solutions & Custom Software Development
Cost to Outsource Software Development in 2025
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025

The TensorFlow dance craze

  • 2. TensorFlow is a Machine Learning library
  • 3. What is Machine Learning? usually: Statistical Pattern Matching Using past measurements to predict something about a new piece of information
  • 4. Does this picture contain a cat? Classification How much is this home worth? Regression Regression Talk https://docs.google.com/presentation/d/17FoojZ17DKDZqoByhB16PmtAXtnJ tXSy1-feK9-A_fg/edit#slide=id.p10
  • 5. There are lots of other ML libraries
  • 6. Is it right for you? Maybe Not, use Prediction API http://www.slideshare.net/gabehamilton/intro-to-google-prediction-api-15167420 Or equivalent Amazon or Microsoft APIs if you have a CSV of observed data.
  • 7. But I’d like to get into the details or I am working on a complex problem...
  • 8. You do still have some choices. Some people prefer Keras on top of TensorFlow https://keras.io/ or tf-slim or pretty-tensor
  • 9. So why use TensorFlow? It’s not much different than the “easier” libraries. You’ll want to understand more and more details anyway. Because you like It has the hottest dance moves!
  • 10. Look out a Tensor!
  • 11. Some Math and a Multi-Dimensional Array had a baby
  • 12. For our purposes It’s a multi-dimensional array. Just remember that you are putting a mathematical construct in that array. A tensor is a multi-dimensional array with certain transformation properties
  • 13. You have some data Even though it’s in a 2D spreadsheet it can describe a multidimensional space. House Price Data 1 mile to park 2 bedrooms 1800 sq ft So our Tensor is [1, 2, 1800]Square footage Distance to park # of bathrooms
  • 14. Let’s build a Tensor Machine = a Tensor
  • 15. Comparing output is our Output But we are expecting - = Loss
  • 16. Iterate until we have a good model
  • 19. Demo code: fitting a line to points Demo is of Datalab notebook # Create 100 phony x, y data points in NumPy, y = x * 0.1 + 0.3 tf.reset_default_graph() import numpy as np import matplotlib.pyplot as plt %matplotlib inline x_measured = np.random.rand(100).astype(np.float32) y_measured = x_measured * (0.1 + (0.05 *np.random.rand(100))) + 0.3 plt.scatter(x_measured, y_measured) plt.xlabel('<- Bluer : Uniform Color : Redder ->') plt.ylabel('Deaths per mission') plt.title('Star Trek Uniform Color Mortality Incidence') # plt.plot([0, 1], [0, 0.5], color='purple', lw=2) # plt.plot([0, 1], [0.25, 0.5], color='purple', lw=2) Measured Data
  • 20. Demo code continued import tensorflow as tf # Try to find values for slope and offset that match # y_measured = slope * x_measured + offset slope = tf.Variable(tf.random_uniform([1], -1.0, 1.0)) offset = tf.Variable(tf.zeros([1])) y_predicted = slope * x_measured + offset loss = tf.reduce_mean(tf.square(y_predicted - y_measured)) optimizer = tf.train.GradientDescentOptimizer(0.5) train = optimizer.minimize(loss) A test value for slope
  • 21. Demo code continued # Launch the graph. sess = tf.Session() sess.run(tf.initialize_all_variables()) # and initialize variables # Fit the line. print 'step #t', 'slopett', 'offset' for step in range(201): sess.run(train) if step % 20 == 0: print step,'t', sess.run(slope)[0], 't', sess.run(offset)[0] A test value for slope and offset
  • 22. Q & A Plus more slides for longer talks or answering questions
  • 23. Why TensorFlow is useful Build your graph in a high level language, execute in fast implementations. Distribute graph operations across processors. Whole graph can be optimized.
  • 24. 4+ D Spaces A given measurement all fits into a simple Tensor: [4, 4, 4, 3]
  • 25. Some Tensors Scalar 0.2 Vector [1, 2, 1800] Matrix [2, 1, 1], [1, 2, 0], [0, 1, 0] n-Tensors
  • 26. Rank 2 Tensor When a bunch of vectors hang out they make a Matrix [2, 1, 1], [1, 2, 0], [0, 1, 0]