Machine Intelligence at Google Scale: TensorFlow

28
Machine Intelligence at Google Scale: TensorFlow

Transcript of Machine Intelligence at Google Scale: TensorFlow

Page 1: Machine Intelligence at Google Scale: TensorFlow

Machine Intelligence at Google Scale:

TensorFlow

Page 2: Machine Intelligence at Google Scale: TensorFlow

Data is Everything.How well you use your data can determine the degree of your success.

Page 3: Machine Intelligence at Google Scale: TensorFlow

What is Machine Learning?

data algorithm insight

Page 4: Machine Intelligence at Google Scale: TensorFlow

Beach

Woman

Pool

Coast

Water

Page 5: Machine Intelligence at Google Scale: TensorFlow

Google Translate

Page 6: Machine Intelligence at Google Scale: TensorFlow

Human: Someone is using a small grill to melt his sandwich.

Neural Model: A person is cooking some food on a grill.

Page 7: Machine Intelligence at Google Scale: TensorFlow

One example (of 100s): “Neural Art” in TensorFlow

An implementation of "A neural algorithm of Artistic style" in TensorFlow, for

● Introductory, hackable demos for TensorFlow, and

● Demonstrating the use of importing various Caffe cnn models (VGG and illustration2vec) in TF.

github.com/woodrush/neural-art-tf

Page 8: Machine Intelligence at Google Scale: TensorFlow

Growing Use of Deep Learning at GoogleNumber of directories containing model description files

Uniq

ue P

roje

ct D

irect

orie

s

Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3

2000

1500

1000

500

0

Across many products/areas● Apps● Maps● Photos● Gmail● Speech● Android● YouTube● Translation● Robotics Research● Image Understanding● Natural Language

Understanding● Drug Discovery

2012 2013 2014 2015

Q4

Page 9: Machine Intelligence at Google Scale: TensorFlow

The Machine Learning Spectrum

TensorFlow Cloud Machine Learning Machine Learning APIs

Data Scientist

Page 10: Machine Intelligence at Google Scale: TensorFlow

TensorFlow

Page 11: Machine Intelligence at Google Scale: TensorFlow

● Google's open source library for machine intelligence

● Tensor: N-dimensional array

● Flow: data flow computation framework (like MapReduce)

● tensorflow.org launched in Nov 2015○ Most popular Machine Learning library○ 20,000+ stars / 7000+ forks ○ 165 contributors / > 3000 commits

What is TensorFlow?

Page 12: Machine Intelligence at Google Scale: TensorFlow

Portable● Training on:

○ Data Center

○ CPUs, GPUs and etc

● Running on:

○ Mobile phones

○ IoT devices

Page 13: Machine Intelligence at Google Scale: TensorFlow

Computation as a Dataflow Graph

Graph of Nodes, also called operations (ops)

MatMul

Add Softmax

biases

weights

inputs

targets

Xent

Page 14: Machine Intelligence at Google Scale: TensorFlow

Dataflow Graph (forward)

Edges are N-dimensional arrays: Tensors

MatMul

Add Softmax

biases

weights

inputs

targets

Xent

Page 15: Machine Intelligence at Google Scale: TensorFlow

Dataflow Graph (backward graph and updates)Backward graph and update are added automatically to graph

Add Mul

biases

...

learning rate

−=...

'Biases' is a variable −= updates biasesSome ops compute gradients

Page 16: Machine Intelligence at Google Scale: TensorFlow

Dataflow Graph ● In practice often very complex with 100s

or 1000s of nodes and edges● “Inference” means to execute just the

forward path of the graph

Page 17: Machine Intelligence at Google Scale: TensorFlow

Example: Logistic Regression1. N examples of data

○ Input xn○ Target tn

2. Model with parameters (weights W, biases b)○ yn = Softmax(W * xn + b)

3. CrossEntropy loss to minimize○ loss = -Sum(tn * ln(yn))

4. Minimization by Gradient Descent○ requires gradients of loss with respect to parameters W, b

● TensorFlow does automatic differentiation● Gradient calculation done by TF once model & loss defined

Page 18: Machine Intelligence at Google Scale: TensorFlow

Visualizing learning

Page 19: Machine Intelligence at Google Scale: TensorFlow

Visualizing graphs

Page 20: Machine Intelligence at Google Scale: TensorFlow

Portable● Training on:

○ Data Center

○ CPUs, GPUs and etc

● Running on:

○ Mobile phones

○ IoT devices

Page 21: Machine Intelligence at Google Scale: TensorFlow

TensorBoard: visualization tool

Page 22: Machine Intelligence at Google Scale: TensorFlow

The Machine Learning Spectrum

TensorFlow Cloud Machine Learning Machine Learning APIs

Application Developer

Data Scientist

Page 23: Machine Intelligence at Google Scale: TensorFlow

Cloud Machine Learning Platform

Pre-Processing TrainingML Authoring

ML Analysis

Hosted Model Monitoring & Logging

Training

Prediction

● Intelligent Text Processing● Image Feature Processing

● Managed Infrastructure● Scalable Algorithms● HW Acceleration

Evaluation

● Detailed Model Metrics● In-process model viz● No-ops experience

Batch

Real-Time

input

output

● Hosted Model experience● AutoScaling● Anytime access

Data

Console

Model & Job Mgmt

Datalab

Page 24: Machine Intelligence at Google Scale: TensorFlow

Can I Hug That?

Page 25: Machine Intelligence at Google Scale: TensorFlow

Can I Hug That?

Images

Labels

Trained Classifier

Question

Hug / Not Hug

Page 26: Machine Intelligence at Google Scale: TensorFlow

Demo

Page 27: Machine Intelligence at Google Scale: TensorFlow
Page 28: Machine Intelligence at Google Scale: TensorFlow

Confidential & ProprietaryGoogle Cloud Platform 28

Easy to use API: pass in an image, we give you insight:

Google Cloud Vision API

Label Detection OCR

Explicit Content Detection

Facial Detection

Landmark Detection

Logo Detection