Machine Learning with TensorFlow 101
North Atlanta Machine Learning Meetup
April 25, 2017
Outline
• Tensorflow
– Overview
– Tensorflow Programming Model
• Simplified View of Machine Learning
• Linear Regression in Tensorflow
• Deep Learning with Tensorflow
About me
About me
• Entrepreneur
• MLATL meetup
• Fintech, Supply Chain,
Healthcare
• Dabbling with ML for the
past 3 years with Spark,
H20.ai and Tensorflow
• Love coding, traveling
About
• Bridging gap between
research and industry
• Tailored Analytics/ML
solutions
– Deep Learning / ML / AI
– Custom Data Applications
– Architecture/Strategy
• Training
• Started as Machine
Learning based Customer
Engagement platform for
banks
Before getting started
• Install Docker for your platform
• Install TensorFlow 0.11
• Don’t want to write code?
– Welcome to simply observe as well
docker run –it –p 8888:8888 –p 6006:6006 gcr.io/tensorflow/tensorflow
TensorFlow
TensorFlow - Genesis
• Pre-TF – (Math libaries without distribution)
– Matlab
– SciPy
– Octave
• Computational Graph, Automatic Differentiation
– Theano
– Torch
– DL4J
• On comes TensorFlow
– Distributed, GPU-support
– MxNet also has similar capabilities
– Keras is a higher level DL framework that can plug into TF or Theano (now almost every other DL framework)
• Popular non-differentiating approaches
– Spark, Flink
– H2O.ai
TensorFlow is not a panacea
• Actively evolving – current version is 0.11. Although used heavily within
Google. But it has excellent community support
• Over 600 operations. Programming model not very elegant
• Sometimes it can get cumbersome
– MatLab:
– TensorFlow:
• Mostly designed well, but you can see evidence of flaws
• Highly optimized for a specific class of problems
• Aggregations are limited. No custom aggregations
What’s that got to do with a while loop??
Program execution
Write Code
Source: TensorFlow Paper, Google Research
Creates an execution graph
Graphs
• Nodes can be
– Data nodes
– Operations
– Summaries
• Edges show the computation flow
• Data nodes can be,
– Variables
– Constants
– Placeholders
Source: TensorFlow Paper, Google Research
LET’S CODE OUR FIRST GRAPH
Distributed execution
Source: TensorFlow Paper, Google Research
Partial Execution
• After defining the
computational graph we
can turn evaluate some
parts
• Partial update is not
necessarily incremental
update
• Incremental update is
possible but hard to
debug
Source: TensorFlow Paper, Google Research
Data Parallel execution
Source: TensorFlow Paper, Google Research
Model Parallel execution
Source: TensorFlow Paper, Google Research
Debugging – Tensorboard is your friend
Source: TensorFlow Paper, Google Research

TensorFlow 101

  • 1.
    Machine Learning withTensorFlow 101 North Atlanta Machine Learning Meetup April 25, 2017
  • 2.
    Outline • Tensorflow – Overview –Tensorflow Programming Model • Simplified View of Machine Learning • Linear Regression in Tensorflow • Deep Learning with Tensorflow
  • 3.
    About me About me •Entrepreneur • MLATL meetup • Fintech, Supply Chain, Healthcare • Dabbling with ML for the past 3 years with Spark, H20.ai and Tensorflow • Love coding, traveling About • Bridging gap between research and industry • Tailored Analytics/ML solutions – Deep Learning / ML / AI – Custom Data Applications – Architecture/Strategy • Training • Started as Machine Learning based Customer Engagement platform for banks
  • 4.
    Before getting started •Install Docker for your platform • Install TensorFlow 0.11 • Don’t want to write code? – Welcome to simply observe as well docker run –it –p 8888:8888 –p 6006:6006 gcr.io/tensorflow/tensorflow
  • 5.
  • 6.
    TensorFlow - Genesis •Pre-TF – (Math libaries without distribution) – Matlab – SciPy – Octave • Computational Graph, Automatic Differentiation – Theano – Torch – DL4J • On comes TensorFlow – Distributed, GPU-support – MxNet also has similar capabilities – Keras is a higher level DL framework that can plug into TF or Theano (now almost every other DL framework) • Popular non-differentiating approaches – Spark, Flink – H2O.ai
  • 7.
    TensorFlow is nota panacea • Actively evolving – current version is 0.11. Although used heavily within Google. But it has excellent community support • Over 600 operations. Programming model not very elegant • Sometimes it can get cumbersome – MatLab: – TensorFlow: • Mostly designed well, but you can see evidence of flaws • Highly optimized for a specific class of problems • Aggregations are limited. No custom aggregations What’s that got to do with a while loop??
  • 8.
    Program execution Write Code Source:TensorFlow Paper, Google Research Creates an execution graph
  • 9.
    Graphs • Nodes canbe – Data nodes – Operations – Summaries • Edges show the computation flow • Data nodes can be, – Variables – Constants – Placeholders Source: TensorFlow Paper, Google Research
  • 10.
    LET’S CODE OURFIRST GRAPH
  • 11.
  • 12.
    Partial Execution • Afterdefining the computational graph we can turn evaluate some parts • Partial update is not necessarily incremental update • Incremental update is possible but hard to debug Source: TensorFlow Paper, Google Research
  • 13.
    Data Parallel execution Source:TensorFlow Paper, Google Research
  • 14.
    Model Parallel execution Source:TensorFlow Paper, Google Research
  • 15.
    Debugging – Tensorboardis your friend Source: TensorFlow Paper, Google Research