Top Banner
Introduction to Deep Learning Introduction (1) Prof. Songhwai Oh ECE, SNU Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 1
42

Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

May 20, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Introduction to Deep LearningIntroduction (1)

Prof. Songhwai OhECE, SNU

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 1

Page 2: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

INTELLIGENT SYSTEMS

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 2

Page 3: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

What is Intelligence?

Wikipedia A very general mental capability that, among other things, involves the ability to reason, plan, solve problems, think abstractly, comprehend complex ideas, learn quickly and learn from experience. It is not merely book learning, a narrow academic skill, or test‐taking smarts. Rather, it reflects a broader and deeper capability for comprehending our surroundings—"catching on," "making sense" of things, or "figuring out" what to do. [Gottfredson, Linda S. (1997). "Mainstream Science on Intelligence (editorial)". Intelligence 24: 13–23.]

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 3

Merriam‐Webster(1) : the ability to learn or understand or to deal with new or trying situations : reason; also : the skilled use of reason (2) : the ability to apply knowledge to manipulate one's environment or to think abstractly as measured by objective criteria (as tests) 

Page 4: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Intelligent Systems

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 4

BigDog (2005) PR2 (UC Berkeley, 2010) Google Car (2014)

Environment

Intelligent System

Sensing Processing Action

Page 5: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Course Outline

(Day 1) Introduction I– AI, machine learning, linear regression

(Day 2) Introduction II– Linear classification, neural networks– Deep learning overview

(Day 3) Convolutional neural networks– Convolution, ReLU, pooling– Gradient descent, dropout, batch 

normalizations– AlexNet, VGGNet, ResNet

(Day 4) Recurrent neural networks– RNN, LSTM, GRU, Seq2Seq

(Day 5) Advanced topics– Generative adversarial networks, NestedNet– Deep reinforcement learning

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5

TensorFlow, linear regression

MNIST classification using multilayer perceptron (MLP)

MNIST classification using CNNs

CIFAR‐10 image classification

Name generation using RNNs

Lab

Page 6: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

ARTIFICIAL INTELLIGENCE (AI)

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 6

Page 7: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Artificial Intelligence (AI)

• Closely related field• Heavily focused on (e.g., traditional AI)

– Processing– Discrete world– Logic

• Four popular views about AI

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 7

Thinking Humanly Thinking RationallyActing Humanly Acting Rationally

Page 8: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Acting Humanly: Turing Test

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 8

Turing (1950) "Computing machinery and intelligence":• "Can machines think?"  "Can machines behave intelligently?"• Operational test for intelligent behavior: the Imitation Game

• Predicted that by 2000, a machine might have a 30% chance of fooling a lay person for 5 minutes

• Eugene Goostman (chatterbot) passed the Turing test on June 7, 2014 (10 out of 30 judges). http://www.princetonai.com/

• Anticipated all major arguments against AI in following 50 years

• Chinese room argument (Searle)• Suggested major components of AI: knowledge, 

reasoning, language understanding, learning

Problem: Turing test is not reproducible, constructive, or amenable to mathematical analysis.

The Imitation Game(2014)

Page 9: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Thinking Humanly: Cognitive Science• 1960s "cognitive revolution": information‐processing 

psychology • Requires scientific theories of internal activities of the brain

– What level of abstraction? Knowledge or circuits?– How to validate? Requires 

• Predicting and testing behavior of human subjects (top‐down)• Direct identification from neurological data (bottom‐up)

• Both approaches (roughly, Cognitive Science and Cognitive Neuroscience) are now distinct from AI

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 9

Page 10: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Thinking Rationally: Laws of Thought• Normative (or prescriptive) rather than descriptive• Aristotle: what are correct arguments/thought processes?• Several Greek schools developed various forms of logic: 

notation and rules of derivation for thoughts; may or may not have proceeded to the idea of mechanization

• Direct line through mathematics and philosophy to modern AI• Problems: 

– Informal or uncertain knowledge cannot be precisely stated formally – Big difference between solving a problem “in principle” and solving it 

in practice

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 10

Page 11: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Acting Rationally: Rational Agent

• Rational behavior: doing the right thing• The right thing: that which is expected to maximize goal 

achievement, given the available information• Doesn't necessarily involve thinking – e.g., blinking reflex –

but  thinking should be in the service of rational action• Computational limitations make perfect rationality 

unachievable– Design the best program for given machine resources

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 11

Page 12: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

TRADITIONAL AI

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 12

Page 13: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Search

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 13

E.g., 8‐Puzzle

Search Algorithms: • Breadth‐first search• Depth‐first search• A* search• and many more.

Page 14: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Game

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 14

IBM Deep Blue vs. World Chess Champion Garry Kasparov, 1997 First match• February 10, 1996: takes place in 

Philadelphia, Pennsylvania• Result: Kasparov–Deep Blue (4–2)• Record set: First computer program 

to defeat a world champion in a game under tournament regulations

Second match (rematch)• May 11, 1997: held in New York City, 

New York• Result: Deep Blue–Kasparov (3½–

2½)• Record set: First computer program 

to defeat a world champion in a match under tournament regulations

Alpha‐Beta Pruning

Page 15: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Propositional Logic

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 15

Page 16: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

First‐Order Logic

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 16

Page 17: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Planning

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 17

Page 18: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

MACHINE LEARNING

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 18

Page 19: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Learning

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 19

Page 20: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Types of Learning

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 20

Page 21: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Supervised Learning

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 21

Page 22: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 22

Page 23: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

GENERALIZATION ERROR

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 23

Page 24: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Overfitting and Other Considerations

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 24

Page 25: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Loss Function

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 25

Page 26: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Cross Validation, Model Selection

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 26

Page 27: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

THREE MAJOR MACHINE LEARNINGPROBLEMS

ClassificationRegressionDensity Estimation

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 27

Page 28: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Classification

Data: {(xi, yi): i=1,…,N} xi: input feature; yi: class label 

Given a new input feature, classify its label.

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 28

Example: Human detection

HOGHistogram of Oriented 

GradientsTraining set

Positive samples

Negative samples

Support VectorMachine (SVM) Classifier

Feature Extraction

Page 29: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Regression

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 29

Data: {(xi, yi): i=1,…,N} xi: input; yi: output

Given data, find a function f such that f(xi) ≈ yi.

Example: Chemical concentration mapping

Chemical concentration prediction by Gaussian process regression

Page 30: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Density Estimation

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 30

Data: {xi: i=1,…,N} xi: feature

Given data, find the distribution (or a simpler description) of xi.Unsupervised learning

Example: Background subtraction, Dimensionality reduction

Isomap, Locally linear embedding (LLE)Background modeling using a mixture of Gaussians 

Page 31: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

LINEAR REGRESSION

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 31

Page 32: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Univariate Linear Regression

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 32

Page 33: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Example

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 33

Page 34: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Gradient Descent

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 34

Batch gradient descent:(Steepest descent)

Stochastic gradient descent: processes one data point at a time

Page 35: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Multivariate Linear Regression

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 35

Page 36: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Closed‐Form Solution to Linear Regression

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 36

Page 37: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

General Linear Model

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 37

hi[n]: nonlinear function of n

Page 38: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Example: Linear modeling of the SINC function

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 38

Model 2:

Model 1:

Page 39: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 39

N=50 N=100 N=1000

Data

LinearModel 1

LinearModel 2

Example: Linear modeling of the SINC function

Page 40: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Regularization

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 40

L1 Regularization L2 Regularization

Page 41: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

WRAP UP

AIMachine LearningGeneralization ErrorClassificationRegression

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 41

Page 42: Introduction to Deep Learning - RLLAB @ SNUrllab.snu.ac.kr/courses/deep-learning-2018/files/01_dl_intro_p1.pdfProf. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 5 TensorFlow,

Intelligent Systems

Prof. Songhwai Oh (ECE, SNU) Introduction to Deep Learning 42

BigDog (2005) PR2 (UC Berkeley, 2010) Google Car (2014)

Environment

Intelligent System

Sensing Processing Action