37

Click here to load reader

Introduction to Deep Learning with TensorFlow

Embed Size (px)

Citation preview

Page 1: Introduction to Deep Learning with TensorFlow

1Terry Taewoong Um ([email protected])

University of Waterloo

Department of Electrical & Computer Engineering

Terry Taewoong Um

INTRODUCTION TO DEEP NEURAL NETWORK WITH TENSORFLOW

Page 2: Introduction to Deep Learning with TensorFlow

2Terry Taewoong Um ([email protected])

CONTENTS

1. Why Deep Neural Network

Page 3: Introduction to Deep Learning with TensorFlow

3Terry Taewoong Um ([email protected])

EXAMPLE CASE

- Imagine you have extracted features from sensors

- The dimension of each sample (which represents one of gestures) is around 800

- You have 70,000 samples (trial)

- What method would you apply?

Page 4: Introduction to Deep Learning with TensorFlow

4Terry Taewoong Um ([email protected])

EXAMPLE CASE

- Reduce the dimension from 800 to 40 by using a feature selection or dim. reduction technique

☞ What you did here is “Finding a good representation”

- Then, you may apply a classification methods to classify 10 classes

• You may have several ways to do it

• But, what if

- You have no idea for feature selection?

- The dimension is much higher than 800 and you have more classes.

?

Page 5: Introduction to Deep Learning with TensorFlow

5Terry Taewoong Um ([email protected])

EXAMPLE CASE

- Reduce the dimension from 800 to 40 by using a feature selection or dim. reduction technique

☞ What you did here is “Finding a good representation”

- Then, you may apply a classification methods to classify 10 classes

• You may have several ways to do it

• But, what if

- You have no idea for feature selection?

- The dimension is much higher than 800 and you have more classes.

MNIST dataset(65000spls * 784dim)

MNIST dataset(60000spls * 1024dim)

Page 6: Introduction to Deep Learning with TensorFlow

6Terry Taewoong Um ([email protected])

CLASSIFICATION RESULTS

error rate : 28% → 15% → 8%(2010) (2014)(2012)

http://rodrigob.github.io/are_we_there_yet/build/classification_datasets_results.html

Page 7: Introduction to Deep Learning with TensorFlow

7Terry Taewoong Um ([email protected])

PARADIGM CHANGE

Knowledge

PRESENT

Representation(Features)

How can we find a good representation?

IMAGE

SPEECH

Hand-Crafted Features

Page 8: Introduction to Deep Learning with TensorFlow

8Terry Taewoong Um ([email protected])

PARADIGM CHANGE

IMAGE

SPEECH

Hand-Crafted Features

Knowledge

PRESENT

Representation(Features)

Can we learn a good representation (feature) for the target task as well?

Page 9: Introduction to Deep Learning with TensorFlow

9Terry Taewoong Um ([email protected])

UNSUPERVISED LEARNING

“Convolutional deep belief networks for scalable unsupervised learning of hierarchical representation”, Lee et al., 2012

Page 10: Introduction to Deep Learning with TensorFlow

10Terry Taewoong Um ([email protected])

THREE TYPES OF DEEP LEARNING• Unsupervised learning method

Autoencoder http://goo.gl/s6kmqY

- Restricted Boltzmann Machine(RBM), Autoencoder, etc.

- It helps to avoid local minima problem (It regularizes the training data)

- But it is not necessary when we have large amount of data. (Drop-out is enough for regularization)

• Convolutional Neural Network (ConvNet)

• Recurrent Neural Network (RNN) + Long-Short Term Memory (LSTM)

- ConvNet has shown outstanding performance in recognition tasks (image, speech)

- ConvNet contains hierarchical abstraction process called pooling.

- RNN+LSTM makes use of long-term memory → Good for time-series data

- RNN is a generative model: It can generate new data

Page 11: Introduction to Deep Learning with TensorFlow

11Terry Taewoong Um ([email protected])

CONTENTS

2. DNN with TensorFlowThanks to Sungjoon Choi

https://github.com/sjchoi86/

Page 12: Introduction to Deep Learning with TensorFlow

12Terry Taewoong Um ([email protected])

DEEP LEARNING LIBRARIES

Page 13: Introduction to Deep Learning with TensorFlow

13Terry Taewoong Um ([email protected])

DEEP LEARNING LIBRARY

Page 14: Introduction to Deep Learning with TensorFlow

14Terry Taewoong Um ([email protected])

DEEP LEARNING LIBRARY

• Karpathy’s Recommendation

Page 15: Introduction to Deep Learning with TensorFlow

15Terry Taewoong Um ([email protected])

BASIC WORKFLOW OF TF

1. Load data

2. Define the NN structure

3. Set optimization parameters

4. Run!https://github.com/terryum/TensorFlow_Exercises

Page 16: Introduction to Deep Learning with TensorFlow

16Terry Taewoong Um ([email protected])

EXAMPLE 1

https://github.com/terryum/TensorFlow_Exercises

Page 17: Introduction to Deep Learning with TensorFlow

17Terry Taewoong Um ([email protected])

1. LOAD DATA https://github.com/terryum/TensorFlow_Exercises/blob/master/2_LogisticRegression_MNIST_160516.ipynb

Page 18: Introduction to Deep Learning with TensorFlow

18Terry Taewoong Um ([email protected])

1. LOAD DATA

Page 19: Introduction to Deep Learning with TensorFlow

19Terry Taewoong Um ([email protected])

2. DEFINE THE NN STRUCTURE

3. SET OPTIMIZATION PARAMETERS

Page 20: Introduction to Deep Learning with TensorFlow

20Terry Taewoong Um ([email protected])

4. RUN

Page 21: Introduction to Deep Learning with TensorFlow

21Terry Taewoong Um ([email protected])

4. RUN (C.F.)

Page 22: Introduction to Deep Learning with TensorFlow

22Terry Taewoong Um ([email protected])

EXAMPLE 2

https://github.com/terryum/TensorFlow_Exercises

Page 23: Introduction to Deep Learning with TensorFlow

23Terry Taewoong Um ([email protected])

NEURAL NETWORK

Hugo Larochelle, http://www.dmi.usherb.ca/~larocheh/index_en.html

• Activation functions

http://goo.gl/qMQk5H

• Basic NN structure

Page 24: Introduction to Deep Learning with TensorFlow

24Terry Taewoong Um ([email protected])

1. LOAD DATA https://github.com/terryum/TensorFlow_Exercises/blob/master/3a_MLP_MNIST_160516.ipynb

Page 25: Introduction to Deep Learning with TensorFlow

25Terry Taewoong Um ([email protected])

2. DEFINE THE NN STRUCTURE

Page 26: Introduction to Deep Learning with TensorFlow

26Terry Taewoong Um ([email protected])

3. SET OPTIMIZATION PARAMETERS

Page 27: Introduction to Deep Learning with TensorFlow

27Terry Taewoong Um ([email protected])

4. RUN

Page 28: Introduction to Deep Learning with TensorFlow

28Terry Taewoong Um ([email protected])

EXAMPLE 3

https://github.com/terryum/TensorFlow_Exercises

Page 29: Introduction to Deep Learning with TensorFlow

29Terry Taewoong Um ([email protected])

CONVOLUTION

http://colah.github.io/posts/2014-07-Understanding-Convolutions/

http://www.wildml.com/2015/11/understanding-convolutional-neural-networks-for-nlp/

Page 30: Introduction to Deep Learning with TensorFlow

30Terry Taewoong Um ([email protected])

CONVOLUTIONAL NN

• How can we deal with real images which is much bigger than MNIST digit images?

- Use not fully-connected, but locally-connected NN

- Use convolutions to get various feature maps

- Abstract the results into higher layer by using pooling

- Fine tune with fully-connected NN

https://goo.gl/G7kBjI

https://goo.gl/Xswsbd

http://goo.gl/5OR5oH

Page 31: Introduction to Deep Learning with TensorFlow

31Terry Taewoong Um ([email protected])

1. LOAD DATA https://github.com/terryum/TensorFlow_Exercises/blob/master/4a_CNN_MNIST_160517.ipynb

Page 32: Introduction to Deep Learning with TensorFlow

32Terry Taewoong Um ([email protected])

2. DEFINE THE NN STRUCTURE

Page 33: Introduction to Deep Learning with TensorFlow

33Terry Taewoong Um ([email protected])

2. DEFINE THE NN STRUCTURE

Page 34: Introduction to Deep Learning with TensorFlow

34Terry Taewoong Um ([email protected])

3. SET OPTIMIZATION PARAMETERS

Page 35: Introduction to Deep Learning with TensorFlow

35Terry Taewoong Um ([email protected])

4. RUN

Page 36: Introduction to Deep Learning with TensorFlow

36Terry Taewoong Um ([email protected])

4. RUN (C.F.)

Page 37: Introduction to Deep Learning with TensorFlow

37Terry Taewoong Um ([email protected])

Thank you

https://www.facebook.com/terryum

http://terryum.io/

http://t-robotics.blogspot.kr/