Kaz Sato, Evangelist, Google at MLconf ATL 2016

76
Machine Intelligence at Google Scale ML APIs, TensorFlow and Cloud ML

Transcript of Kaz Sato, Evangelist, Google at MLconf ATL 2016

Page 1: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Machine Intelligence at Google ScaleML APIs, TensorFlow and Cloud ML

Page 2: Kaz Sato, Evangelist, Google at MLconf ATL 2016

+Kazunori Sato@kazunori_279

Kaz Sato

Staff Developer AdvocateTech Lead for Data & AnalyticsCloud Platform, Google Inc.

Page 3: Kaz Sato, Evangelist, Google at MLconf ATL 2016

What we’ll cover

What is Neural Network and Deep Learning

Machine Learning use cases at Google services

Externalizing the power with ML APIs

TensorFlow: the open source library for ML

TensorFlow in the Wild

Distributed training and prediction with Cloud ML

Page 4: Kaz Sato, Evangelist, Google at MLconf ATL 2016

What is Neural Network and Deep Learning

Page 5: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Neural Network is a function that can learn

Page 6: Kaz Sato, Evangelist, Google at MLconf ATL 2016

xn

> b?

w1

wn

x2

x1

Inspired by the behavior of biological neurons

Page 7: Kaz Sato, Evangelist, Google at MLconf ATL 2016

How do you classify them?

Page 8: Kaz Sato, Evangelist, Google at MLconf ATL 2016

weights

bias(threshold)

Programmers need to specify the parameters

Page 9: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Let’s see how neural network solves the problem

Page 10: Kaz Sato, Evangelist, Google at MLconf ATL 2016

The computer tries to find the best parameters

A neuron classifies a data point into two kinds

Page 11: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Gradient Descent: adjusting the params gradually to reduce errors

From: Andrew Ng

Page 12: Kaz Sato, Evangelist, Google at MLconf ATL 2016

How do you classify them?

Page 13: Kaz Sato, Evangelist, Google at MLconf ATL 2016

What we see What the computer “sees”

Page 14: Kaz Sato, Evangelist, Google at MLconf ATL 2016

28 x 28 gray scale image =

784 numbers

Page 15: Kaz Sato, Evangelist, Google at MLconf ATL 2016

input vector (pixel data)

output vector (probability)

Page 16: Kaz Sato, Evangelist, Google at MLconf ATL 2016

How do you classify them?

Page 17: Kaz Sato, Evangelist, Google at MLconf ATL 2016

More neurons = More features to extract

Page 18: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Hidden Layers:

mapping inputs to

a feature space,

classifying with

a hyperplaneFrom: Neural Networks, Manifolds, and Topology, colah's blog

Page 19: Kaz Sato, Evangelist, Google at MLconf ATL 2016

How about this?

Page 20: Kaz Sato, Evangelist, Google at MLconf ATL 2016

More hidden layers = More hierarchies of features

Page 21: Kaz Sato, Evangelist, Google at MLconf ATL 2016

How about this?

Page 22: Kaz Sato, Evangelist, Google at MLconf ATL 2016

We need to go deeper neural network

From: Convolutional Deep Belief Networks for Scalable Unsupervised Learning of Hierarchical Representations, Honglak Lee et al.

Page 23: Kaz Sato, Evangelist, Google at MLconf ATL 2016

From: mNeuron: A Matlab Plugin to Visualize Neurons from Deep Models, Donglai Wei et. al.

Page 24: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Machine Learning use casesat Google services

Page 25: Kaz Sato, Evangelist, Google at MLconf ATL 2016

25

signalfor Search ranking,

out of hundreds

improvementto ranking quality

in 2+ years

#3 #1

Search

machine learning for search engines

RankBrain: a deep neural network for search ranking

Page 26: Kaz Sato, Evangelist, Google at MLconf ATL 2016
Page 27: Kaz Sato, Evangelist, Google at MLconf ATL 2016

WaveNet by Google DeepMind

Page 28: Kaz Sato, Evangelist, Google at MLconf ATL 2016

28

[glacier]

Google Photos

28

Page 29: Kaz Sato, Evangelist, Google at MLconf ATL 2016

29

Smart reply in Inbox by Gmail

10%of all responses sent on mobile

Page 31: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Saved Data Center cooling energy for 40%Improved Power Usage Effectiveness (PUE) for 15%

Page 32: Kaz Sato, Evangelist, Google at MLconf ATL 2016

32

AndroidAppsGmailMapsPhotosSpeechSearchTranslationYouTubeand many others ...

Used across products:

2012 2013 2014 2015

Deep Learning usage at Google

Page 33: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Externalizing the powerwith ML APIs

Page 34: Kaz Sato, Evangelist, Google at MLconf ATL 2016

TensorFlow Cloud Machine Learning ML API

Easy-to-Use, for non-ML engineers

Customizable, for Data Scientists

Machine Learning products from Google

Page 35: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Image analysis with pre-trained models

No Machine Learning skill required

REST API: receives an image and returns a JSON

General Availability

Cloud Vision API

Page 36: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Confidential & ProprietaryGoogle Cloud Platform 36

FacesFaces, facial landmarks, emotions

OCRRead and extract text, with support for > 10 languages

LabelDetect entities from furniture to transportation

LogosIdentify product logos

Landmarks & Image PropertiesDetect landmarks & dominant color of image

Safe SearchDetect explicit content - adult, violent, medical and spoof

Page 37: Kaz Sato, Evangelist, Google at MLconf ATL 2016

3737

Demo

Page 38: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Pre-trained models. No ML skill required

REST API: receives audio and returns texts

Supports 80+ languages

Streaming or non-streaming

Public Beta - cloud.google.com/speech

Cloud Speech API

Page 39: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Confidential & ProprietaryGoogle Cloud Platform 39

Features

Automatic Speech Recognition (ASR) powered by deep learning neural networking to power your applications like voice search or speech transcription.

Recognizes over 80 languages and variants with an extensive vocabulary.

Returns partial recognition results immediately, as they become available.

Filter inappropriate content in text results.

Audio input can be captured by an application’s microphone or sent from a pre-recorded audio file. Multiple audio file formats are supported, including FLAC, AMR, PCMU and linear-16.

Handles noisy audio from many environments without requiring additional noise cancellation.

Audio files can be uploaded in the request and, in future releases, integrated with Google Cloud Storage.

Automatic Speech Recognition Global Vocabulary Inappropriate Content Filtering

Streaming Recognition

Real-time or Buffered Audio Support Noisy Audio Handling Integrated API

Page 40: Kaz Sato, Evangelist, Google at MLconf ATL 2016

4040

Demo

Page 41: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Pre-trained models. No ML skill required

REST API: receives text and returns analysis results

Supports English, Spanish and Japanese

Public Beta - cloud.google.com/natural-language

Cloud Natural Language API

Page 42: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Confidential & ProprietaryGoogle Cloud Platform 42

Features

Extract sentence, identify parts of speech and create dependency parse trees for each sentence.

Identify entities and label by types such as person, organization, location, events, products and media.

Understand the overall sentiment of a block of text.

Syntax Analysis Entity Recognition

Sentiment Analysis

Page 43: Kaz Sato, Evangelist, Google at MLconf ATL 2016

4343

Demo

Page 44: Kaz Sato, Evangelist, Google at MLconf ATL 2016

TensorFlow:An open source library forMachine Intelligence

Page 45: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Google's open source library for

machine intelligence

tensorflow.org launched in Nov 2015

Used by many production ML projects

What is TensorFlow?

Page 46: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Sharing our tools with researchers and developers around the world

repositoryfor “machine learning”

category on GitHub

#1

Released in Nov. 2015

From: http://deliprao.com/archives/168

Page 47: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Before

Hire Data Scientists↓

Understand the math model↓

Impl with programming code↓

Train with single GPU↓

Build a GPU cluster↓

Train with the GPU cluster↓

Build a prediction serveror Impl mobile/IoT prediction

After

Easy network design and impl

Train with single machine

Train on the cloud

Prediction on the cloud

or mobile/IoT devices

many peoplestuck here

Page 48: Kaz Sato, Evangelist, Google at MLconf ATL 2016

# define the networkimport tensorflow as tfx = tf.placeholder(tf.float32, [None, 784])W = tf.Variable(tf.zeros([784, 10]))b = tf.Variable(tf.zeros([10]))y = tf.nn.softmax(tf.matmul(x, W) + b)

# define a training stepy_ = tf.placeholder(tf.float32, [None, 10])xent = -tf.reduce_sum(y_*tf.log(y))step = tf.train.GradientDescentOptimizer(0.01).minimize(xent)

Page 49: Kaz Sato, Evangelist, Google at MLconf ATL 2016

TensorBoard: visualization tool

Page 50: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Portable and ScalableTraining on:

Mac/Windows

GPU server

GPU cluster / Cloud

Prediction on:

Android and iOS

RasPi and TPU

Page 51: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Distributed Training with TensorFlow

Page 52: Kaz Sato, Evangelist, Google at MLconf ATL 2016

TensorFlow in the Wild(or democratization of deep learning)

Page 53: Kaz Sato, Evangelist, Google at MLconf ATL 2016

TensorFlow

powered

Fried Chicken

Nugget Server

From: http://www.rt-net.jp/karaage1/

Page 54: Kaz Sato, Evangelist, Google at MLconf ATL 2016

TensorFlow powered Cucumber Sorter

From: http://workpiles.com/2016/02/tensorflow-cnn-cucumber/

Page 56: Kaz Sato, Evangelist, Google at MLconf ATL 2016

TV popstar classifierwith 95% accuracy

From: http://memo.sugyan.com/entry/2016/06/14/220624

Page 58: Kaz Sato, Evangelist, Google at MLconf ATL 2016

TensorFlow +

Drones

for counting trucks

From: http://www.brainpad.co.jp/news/2016/09/02/3454

Page 59: Kaz Sato, Evangelist, Google at MLconf ATL 2016

From: http://otoro.net/Generative Arts with TensorFlow

Page 60: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Distributed Training and Prediction with Cloud ML

Page 62: Kaz Sato, Evangelist, Google at MLconf ATL 2016

The Challenge: Computing Power

DNN requires large training datasets

Large models doesn't fit into a GPU

Requires try-and-errors to find the best design, configs and params

↓Need to spend a few days or

weeks to finish a training

Page 63: Kaz Sato, Evangelist, Google at MLconf ATL 2016

GPUs run at nanosecondsGPU cluster needs microsec network

Page 64: Kaz Sato, Evangelist, Google at MLconf ATL 2016
Page 65: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Enterprise

Google Cloud is

The Datacenter as a Computer

Page 66: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Jupiter network

10 GbE x 100 K = 1 Pbps

Consolidates servers with

microsec latency

Page 67: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Borg

No VMs, pure containers

10K - 20K nodes per Cell

DC-scale job scheduling

CPUs, mem, disks and IO

Page 68: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Distributed Training with TensorFlow

by data parallelism

split data,

share model

Page 69: Kaz Sato, Evangelist, Google at MLconf ATL 2016

● CPU/GPU scheduling

● Communications

○ Local, RPC, RDMA

○ 32/16/8 bit quantization

● Cost-based optimization

● Fault tolerance

Distributed Systems for Large Neural Network

Page 70: Kaz Sato, Evangelist, Google at MLconf ATL 2016

What's the scalability of Google Brain?

"Large Scale Distributed Systems for Training Neural

Networks", NIPS 2015

○ Inception / ImageNet: 40x with 50 GPUs

○ RankBrain: 300x with 500 nodes

Page 71: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Fully managed distributed training and prediction

Supports custom TensorFlow graphs

Integrated with Cloud Dataflow and Cloud Datalab

Limited Preview - cloud.google.com/ml

Cloud Machine Learning (Cloud ML)

Page 72: Kaz Sato, Evangelist, Google at MLconf ATL 2016

7272

Ready to use Machine Learning models

Use your own data to train models

Cloud Vision API

Cloud Speech API

Cloud Translate API

Cloud Machine Learning

Develop - Model - Test

Google BigQuery

Stay Tuned….

Cloud Storage

Cloud Datalab

NEW

Alpha

GA BetaGA

AlphaGA

GA

Page 73: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Tensor Processing Unit

ASIC for TensorFlow

Designed by Google

10x better perf / watt

latency and efficiency

bit quantization

Page 74: Kaz Sato, Evangelist, Google at MLconf ATL 2016

TPU on Production

RankBrain

AlphaGo

Google Photos

Speech

and more

Page 75: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Thank you!

Page 76: Kaz Sato, Evangelist, Google at MLconf ATL 2016

Links & Resources

Large Scale Distributed Systems for Training Neural Networks, Jeff Dean and Oriol Vinals

Cloud Vision API: cloud.google.com/vision

Cloud Speech API: cloud.google.com/speech

TensorFlow: tensorflow.org

Cloud Machine Learning: cloud.google.com/ml

Cloud Machine Learning: demo video