deep learning in a nutshell

60
Deep Learning in a nutshell JohnsonChen @ HB TechFriday

Upload: hopebay-technologies-inc

Post on 23-Jan-2018

325 views

Category:

Data & Analytics


1 download

TRANSCRIPT

Page 1: Deep Learning in a nutshell

Deep Learning in a nutshell

JohnsonChen @ HB TechFriday

Page 2: Deep Learning in a nutshell

Agenda

1. Introduction to Deep Learning

2. Training You Own Deep Learning Model

a. Introduction to Tensorflow

Page 3: Deep Learning in a nutshell

What’s deep learning

1. Deep learning is part of a broader family of machine learning methods based on learning representations of data.

2. Deep learning can be applied to binary classification problem ( ), multiclass classification problem ( ).

3. Can we make machine learn by itself?

https://en.wikipedia.org/wiki/Deep_learning#Definitions

Page 4: Deep Learning in a nutshell

https://www.youtube.com/watch?v=4A14mOsT6vQ

Page 5: Deep Learning in a nutshell

Let’s talk about classification

http://www.louisdorard.com/blog/when-machine-learning-fails

Page 6: Deep Learning in a nutshell

Let’s talk about classification

( X1, X2, … )

Model

Page 7: Deep Learning in a nutshell

Build our own model

( X1, X2 )

(1, 1) +

(1, 0) +

(0, 1) +

(0, 0) -

Page 8: Deep Learning in a nutshell

(1, 1)

(1, 0)

(0, 1)

(0, 0)

This is our model

Page 9: Deep Learning in a nutshell
Page 10: Deep Learning in a nutshell

(1, 1)

(1, 0)

(0, 1)

(0, 0)

(0.3, 0.3)

Page 11: Deep Learning in a nutshell

What if ...

(1, 1) -

(1, 0) +

(0, 1) +

(0, 0) -

Page 12: Deep Learning in a nutshell

(1, 1)

(1, 0)

(0, 1)

(0, 0)

Page 13: Deep Learning in a nutshell

To make it “non-linear”

Page 14: Deep Learning in a nutshell
Page 15: Deep Learning in a nutshell

Activation Function

(relu: rectified linear unit)

Page 16: Deep Learning in a nutshell

“non-linear”

Page 17: Deep Learning in a nutshell

So what is deep learning?

Page 18: Deep Learning in a nutshell

Artificial Neural Network (ANN)

http://cs231n.github.io/neural-networks-1/

Page 19: Deep Learning in a nutshell

http://hyinfo.bse.ntu.edu.tw/labweb/ann.htm

Page 20: Deep Learning in a nutshell

Deep Learning (Deep Neural Network, DNN)

Deep = many hidden layers

6 ~ 8 hidden layers

http://markus.com/deep-learning-101/

Page 21: Deep Learning in a nutshell

https://classroom.udacity.com/courses/ud730/

Page 22: Deep Learning in a nutshell

https://classroom.udacity.com/courses/ud730/

Page 23: Deep Learning in a nutshell

ImageNet training set

http://www.slideshare.net/AmazonWebServices/cmp305-deep-learning-on-aws-made-easycmp305

BIG DATA

BIG MODEL

Page 24: Deep Learning in a nutshell

How to train model?

Page 25: Deep Learning in a nutshell

(0, 1)

(0, 0)

(1, 1)

(1, 0)

Page 26: Deep Learning in a nutshell

Let’s try handwriting recognition

Most of slides are borrowed from Hung-yi Lee deep learning talk.

Page 27: Deep Learning in a nutshell

Handwriting recognition

https://www.tensorflow.org/versions/r0.8/tutorials/mnist/beginners/index.html#the-mnist-data

Page 28: Deep Learning in a nutshell
Page 29: Deep Learning in a nutshell

784

28 * 28 = 784

Page 30: Deep Learning in a nutshell

Probability

Answer

Page 31: Deep Learning in a nutshell
Page 32: Deep Learning in a nutshell
Page 33: Deep Learning in a nutshell
Page 34: Deep Learning in a nutshell
Page 35: Deep Learning in a nutshell

Agenda

1. Introduction to Deep Learning

2. Training you own Deep Learning model

a. use Tensorflow

Most of slides are borrowed from Dr. Chung-Cheng Chiu deep learning talk

Page 36: Deep Learning in a nutshell
Page 37: Deep Learning in a nutshell
Page 38: Deep Learning in a nutshell

TensorFlowDeveloped by Google Brain Team

Initial release: November 9, 2015

Used for both Google production and research.

Production: 50 different teams in dozens of commercial Google products, such as Google Voice, Gmail, Google Photos, and Search, etc

Feature:

Python, C/C++ API

support multiple CPUs and GPUs

support mobile computing platforms, including Android and Apple's iOS

Page 39: Deep Learning in a nutshell

TensorFlow = Tensor + Flow

Tensor: n-dimensional arrays

Flow: A sequence of tensor operations

Deep Learning is suitable for TensorFlow, but TensorFlow can do more

Page 40: Deep Learning in a nutshell

Tensor

Page 41: Deep Learning in a nutshell

They are all tensor

Page 42: Deep Learning in a nutshell

Implement it

784 300 100 10

w1 w2 w3

b1 b2 b3

28 * 28 = 784

0 0 0 0 0 1 0 0 0 0

Page 43: Deep Learning in a nutshell

Implement it

Traning Data

Page 44: Deep Learning in a nutshell

Implement it

1. Define variables

2. Create (deep) neural network

3. Define cost function, optimizer

4. Train model parameter

Page 45: Deep Learning in a nutshell

Python code

Page 46: Deep Learning in a nutshell

Define variables

784 300 100 10

x y

w1 w2 w3

b1 b2 b3

Page 47: Deep Learning in a nutshell

Create (deep) neural network

784 300 100 10

x y

w1 w2 w3

b1 b2 b3

Page 48: Deep Learning in a nutshell

Define cost function, optimizer

Page 49: Deep Learning in a nutshell

Train model parameter

Page 50: Deep Learning in a nutshell
Page 51: Deep Learning in a nutshell

Save your model

# defaults to saving all variables - in this case w and b saver = tf.train.Saver()

Page 52: Deep Learning in a nutshell

Code Demo

https://github.com/ChinHui-Chen/tensorflow-nn-example/blob/master/multilayer_perceptron_example_novar.py

Page 53: Deep Learning in a nutshell

Visualization

http://scs.ryerson.ca/~aharley/vis/fc/

Page 54: Deep Learning in a nutshell
Page 55: Deep Learning in a nutshell

More examples

Page 56: Deep Learning in a nutshell

https://www.theinformation.com/How-Deep-Learning-Works-at-Apple-Beyond

Page 57: Deep Learning in a nutshell

AlphaGo: Deep Learning vs

AlphaGo Google DeepMind 3 9 3 15 AlphaGo

5

12 1. 3 9 ( ) 2. 3 10 ( ) 3. 3 12 ( ) 4. 3 13 ( ) 5. 3 15 ( )

Read: Google

Page 58: Deep Learning in a nutshell

Conclusion

Neural network, Deep learning

Create a framework to let machine learn by itself

Sometimes it is too complex to debug

TensorFlow tool

Try to train you own model.

Define input, out, and run/train it

Page 59: Deep Learning in a nutshell

http://www.techinsider.io/what-is-google-tensorflow-2015-11

Page 60: Deep Learning in a nutshell

Thanks