ml with tensorflow - github pages · can you find another w and b for the xor? forward propagation

48
Lecture 9-1 Neural Nets(NN) for XOR Sung Kim <[email protected]>

Upload: vuongnguyet

Post on 29-Jun-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Lecture 9-1 Neural Nets(NN) for XOR

Sung Kim <[email protected]>

Page 2: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

One logistic regression unit cannot separate XOR

Page 3: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Multiple logistic regression units

Page 4: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Neural Network (NN)“No one on earth had found a viable way to train*”

http://cs231n.github.io/convolutional-networks/*Marvin Minsky

Page 5: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

XOR using NN

Page 6: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Neural Net

Page 7: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Neural Net

Page 8: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation
Page 9: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation
Page 10: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation
Page 11: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation
Page 12: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation
Page 13: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Forward propagation

Page 14: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Can you find another W and b for the XOR?

Forward propagation

Page 15: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

NN

Page 16: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Recap: Lec 6-1 Multinomial classification

Page 17: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

NN

How can we learn W, and b from trading data?

Page 18: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

NN

Page 19: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

NN

Page 20: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

NN

How can we learn W1, W2, B1, b2 from training data?

Page 21: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Next

Backpropagation

Page 22: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Lecture 9-2 Backpropagation

Sung Kim <[email protected]>

Page 23: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Neural Network (NN)

How can we learn W1, W2, B1, b2 from training data?

Page 24: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

How can we learn W1, W2, B1, b2 from training data?

G?

Page 25: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Derivation

Page 26: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Perceptrons (1969) by Marvin Minsky, founder of the MIT AI Lab

• We need to use MLP, multilayer perceptrons (multilayer neural nets)

• No one on earth had found a viable way to train MLPs good enough to learn such simple functions.

Page 27: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Backpropagation (1974, 1982 by Paul Werbos, 1986 by Hinton)

https://devblogs.nvidia.com/parallelforall/inference-next-step-gpu-accelerated-deep-learning/

Page 28: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation (chain rule)

Page 29: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation (chain rule)

Page 30: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation (chain rule)

Page 31: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Basic derivative

https://ko.wikipedia.org/wiki/%EB%AF%B8%EB%B6%84

f(x) = 3

f(x) = x

f(x) = 2x

Page 32: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Partial derivative: consider other variables as constants

https://ko.wikipedia.org/wiki/%EB%AF%B8%EB%B6%84

f(x) = 2x

f(x, y) = xy,

@f

@x

f(x, y) = xy,

@f@y

Page 33: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Partial derivative: consider other variables as constants

https://ko.wikipedia.org/wiki/%EB%AF%B8%EB%B6%84

f(x) = 2x f(x) = x+ x

f(x, y) = x+ y,

@f@y

f(x, y) = x+ y,

@f

@x

f(x) = 3

f(x) = x+ 3

Page 34: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation (chain rule)

http://cs231n.stanford.edu/

Page 35: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation (chain rule)

http://cs231n.stanford.edu/

Page 36: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation (chain rule)

http://cs231n.stanford.edu/

Page 37: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation (chain rule)

http://cs231n.stanford.edu/

Page 38: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation (chain rule)

http://cs231n.stanford.edu/

Page 39: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation (chain rule)

http://cs231n.stanford.edu/

Page 40: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation (chain rule)

http://cs231n.stanford.edu/

Page 41: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation (chain rule)

http://cs231n.stanford.edu/

Page 42: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Sigmoid

Page 43: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Sigmoid

Page 44: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation inTensorFlowTensorBoard

Page 45: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation inTensorFlowTensorBoard

Page 46: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Back propagation

Page 47: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Perceptrons (1969) by Marvin Minsky, founder of the MIT AI Lab

• We need to use MLP, multilayer perceptrons (multilayer neural nets)

• No one on earth had found a viable way to train MLPs good enough to learn such simple functions.

Page 48: ML with Tensorflow - GitHub Pages · Can you find another W and b for the XOR? Forward propagation

Next

ReLU