with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5...

169
Introduction to Artificial Intelligence with Python

Transcript of with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5...

Page 1: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Introduction to Artificial Intelligence

with Python

Page 2: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Neural Networks

Page 3: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 4: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 5: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Neural Networks

• Neurons are connected to and receive electrical signals from other neurons.

• Neurons process input signals and can be activated.

Page 6: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

artificial neural network

mathematical model for learning inspired by biological neural networks

Page 7: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Artificial Neural Networks

• Model mathematical function from inputs to outputs based on the structure and parameters of the network.

• Allows for learning the network's parameters based on data.

Page 8: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 9: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 10: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 11: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

(x1, x2)

Page 12: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

h(x1, x2) w0 + w1x1 + w2x2=

Page 13: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

h(x1, x2) w0 + w1x1 + w2x2=

Page 14: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

h(x1, x2) w0 + w1x1 + w2x2=

Page 15: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

ou

tpu

t

w · x0

1step functiong(x) = 1 if x ≥ 0, else 0

Page 16: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

ou

tpu

t

w · x0

1step functiong(x) = 1 if x ≥ 0, else 0

Page 17: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

ou

tpu

t

w · x0

1logistic sigmoid

g(x) =ex

ex + 1

Page 18: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

ou

tpu

t

w · x0

rectified linear unit (ReLU)g(x) = max(0, x)

Page 19: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

h(x1, x2) g(w0 + w1x1 + w2x2)=

Page 20: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

h(x1, x2) g(w0 + w1x1 + w2x2)=

Page 21: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 22: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 23: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

Page 24: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

w1

w2

Page 25: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

w1

w2

g(w0 + w1x1 + w2x2)

Page 26: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

w1

w2

g(w0 + w1x1 + w2x2)

w0

Page 27: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

w1

w2

g(w0 + w1x1 + w2x2)

Page 28: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Or

x y f(x, y)0 0 0

0 1 1

1 0 1

1 1 1

Page 29: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

w1

w2

g(w0 + w1x1 + w2x2)

w0

Page 30: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

1

1

-1

g(-1 + 1x1 + 1x2)

-1 0 1

Page 31: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

1

1

-1

g(-1 + 1x1 + 1x2)

-1 0 1

0

00

Page 32: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

1

1

-1

g(-1 + 1x1 + 1x2)

-1 0 1

0

11

Page 33: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

1

1

-1

g(-1 + 1x1 + 1x2)

-1 0 1

1

11

Page 34: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

And

x y f(x, y)0 0 0

0 1 0

1 0 0

1 1 1

Page 35: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

1

1

-1

g(-1 + 1x1 + 1x2)

-1 0 1

Page 36: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

1

1

-2

g(-2 + 1x1 + 1x2)

-1 0 1

Page 37: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

1

1

-2

g(-2 + 1x1 + 1x2)

-1 0 1

1

11

Page 38: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

1

1

-2

g(-2 + 1x1 + 1x2)

-1 0 1

0

10

Page 39: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 40: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

humidity

pressure

probability of rain

Page 41: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

advertising

month

sales

Page 42: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 43: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 44: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Page 45: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

w1

w2

g(w0 + w1x1 + w2x2)

Page 46: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

w1

w3

g(w0 + w1x1 + w2x2

+ w3x3)w2

x3

Page 47: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

x3

x4

x5

w1

w2

w3

w4

w5

g(5

∑i=1

xiwi + w0)

Page 48: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

x1

x2

xn-1

xn

w1

w2

wn-1

wn

g(n

∑i=1

xiwi + w0)

Page 49: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

gradient descent

algorithm for minimizing loss when training neural network

Page 50: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Gradient Descent

• Start with a random choice of weights.

• Repeat:

• Calculate the gradient based on all data points: direction that will lead to decreasing loss.

• Update weights according to the gradient.

Page 51: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Gradient Descent

• Start with a random choice of weights.

• Repeat:

• Calculate the gradient based on all data points: direction that will lead to decreasing loss.

• Update weights according to the gradient.

Page 52: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Stochastic Gradient Descent

• Start with a random choice of weights.

• Repeat:

• Calculate the gradient based on one data point: direction that will lead to decreasing loss.

• Update weights according to the gradient.

Page 53: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Mini-Batch Gradient Descent

• Start with a random choice of weights.

• Repeat:

• Calculate the gradient based on one small batch: direction that will lead to decreasing loss.

• Update weights according to the gradient.

Page 54: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 55: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 56: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 57: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

rainy

sunny

cloudy

snowy

Page 58: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

rainy

sunny

cloudy

snowy

Page 59: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

rainy

sunny

cloudy

snowy

Page 60: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

rainy

sunny

cloudy

snowy

Page 61: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

rainy

sunny

cloudy

snowy

0.1

0.1

0.2

0.6

Page 62: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

rainy

sunny

cloudy

snowy

0.1

0.1

0.6

0.2

Page 63: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 64: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

action 1

action 2

action 3

action 4

Page 65: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 66: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 67: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 68: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 69: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 70: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 71: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 72: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 73: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 74: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Perceptron

• Only capable of learning linearly separable decision boundary.

Page 75: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

multilayer neural network

artificial neural network with an input layer, an output layer, and at least one hidden layer

Page 76: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 77: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 78: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 79: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 80: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 81: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 82: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 83: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 84: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

backpropagation

algorithm for training neural networks with hidden layers

Page 85: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Backpropagation

• Start with a random choice of weights.

• Repeat:

• Calculate error for output layer.

• For each layer, starting with output layer, and moving inwards towards earliest hidden layer:

• Propagate error back one layer.

• Update weights.

Page 86: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 87: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 88: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 89: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 90: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 91: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 92: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 93: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

deep neural networks

neural network with multiple hidden layers

Page 94: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 95: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Overfitting

Page 96: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

dropout

temporarily removing units — selected at random — from a neural network to prevent over-reliance on certain units

Page 97: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 98: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 99: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 100: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 101: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 102: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

TensorFlow

Page 103: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

playground.tensorflow.org

Page 104: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

computer vision

computational methods for analyzing and understanding digital images

Page 105: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 106: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 107: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 108: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 109: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 255

Page 110: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 255

Page 111: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 255

Page 112: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 25500 255255

Page 113: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 255

0 255

0 255

Page 114: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 255

0 255

0 255

Page 115: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 255

0 255

0 255

Page 116: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 255

0 255

0 255

Page 117: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 255

0 255

0 255

Page 118: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 255

0 255

0 255

Page 119: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 255

0 255

0 255

Page 120: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 255

0 255

0 255

Page 121: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 122: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

...

...

Page 123: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

image convolution

applying a filter that adds each pixel value of an image to its neighbors, weighted according to a kernel matrix

Page 124: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 -1 0

-1 5 -1

0 -1 0

Page 125: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 -1 0

-1 5 -1

0 -1 0

10 20 30 40

10 20 30 40

20 30 40 50

20 30 40 50

Page 126: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 -1 0

-1 5 -1

0 -1 0

10 20 30 40

10 20 30 40

20 30 40 50

20 30 40 50

Page 127: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 -1 0

-1 5 -1

0 -1 0

10 20 30 40

10 20 30 40

20 30 40 50

20 30 40 50

Page 128: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 -1 0

-1 5 -1

0 -1 0

10 20 30 40

10 20 30 40

20 30 40 50

20 30 40 50

10

Page 129: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 -1 0

-1 5 -1

0 -1 0

10 20 30 40

10 20 30 40

20 30 40 50

20 30 40 50

10

Page 130: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 -1 0

-1 5 -1

0 -1 0

10 20 30 40

10 20 30 40

20 30 40 50

20 30 40 50

10 20

Page 131: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 -1 0

-1 5 -1

0 -1 0

10 20 30 40

10 20 30 40

20 30 40 50

20 30 40 50

10 20

40

Page 132: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 -1 0

-1 5 -1

0 -1 0

10 20 30 40

10 20 30 40

20 30 40 50

20 30 40 50

10 20

40

Page 133: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 -1 0

-1 5 -1

0 -1 0

10 20 30 40

10 20 30 40

20 30 40 50

20 30 40 50

10 20

40 50

Page 134: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

0 -1 0

-1 5 -1

0 -1 0

10 20 30 40

10 20 30 40

20 30 40 50

20 30 40 50

10 20

40 50

Page 135: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

-1 -1 -1

-1 8 -1

-1 -1 -1

Page 136: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

-1 -1 -1

-1 8 -1

-1 -1 -1

20 20 20

20 20 20

20 20 20

(20)(-1) + (20)(-1) + (20)(-1) + (20)(-1) + (20)(8) + (20)(-1) + (20)(-1) + (20)(-1) + (20)(-1)

0

Page 137: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

-1 -1 -1

-1 8 -1

-1 -1 -1

20 20 20

50 50 50

50 50 50

(20)(-1) + (20)(-1) + (20)(-1) + (50)(-1) + (50)(8) + (50)(-1) + (50)(-1) + (50)(-1) + (50)(-1)

90

Page 138: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 139: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 140: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

pooling

reducing the size of an input by sampling from regions in the input

Page 141: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

max-pooling

pooling by choosing the maximum value in each region

Page 142: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

30 40 80 90

20 50 100 110

0 10 20 30

10 20 40 30

Page 143: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

30 40 80 90

20 50 100 110

0 10 20 30

10 20 40 30

Page 144: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

30 40 80 90

20 50 100 110

0 10 20 30

10 20 40 30

Page 145: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

30 40 80 90

20 50 100 110

0 10 20 30

10 20 40 30

50

Page 146: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

30 40 80 90

20 50 100 110

0 10 20 30

10 20 40 30

50

Page 147: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

30 40 80 90

20 50 100 110

0 10 20 30

10 20 40 30

50 110

Page 148: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

30 40 80 90

20 50 100 110

0 10 20 30

10 20 40 30

50 110

Page 149: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

30 40 80 90

20 50 100 110

0 10 20 30

10 20 40 30

50 110

20

Page 150: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

30 40 80 90

20 50 100 110

0 10 20 30

10 20 40 30

50 110

20

Page 151: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

30 40 80 90

20 50 100 110

0 10 20 30

10 20 40 30

50 110

20 40

Page 152: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

30 40 80 90

20 50 100 110

0 10 20 30

10 20 40 30

50 110

20 40

Page 153: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

convolutional neural network

neural networks that use convolution, usually for analyzing images

Page 154: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

convolution pooling flattening

Page 155: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

first convolution and pooling

second convolution and pooling

low-level features: edges, curves, shapes

high-level features: objects

Page 156: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 157: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

input network output

Page 158: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

input network output

Page 159: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

feed-forward neural network

neural network that has connections only in one direction

Page 160: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

recurrent neural network

neural network that generates output that feeds back into its own inputs

Page 161: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

input network output

Page 162: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

group of people walking in front of a building

Page 163: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

input network output

network output

network output

network output

Page 164: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...
Page 165: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

input network

network

network

network output

input

input

input

Page 166: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

She is in the library.

她在圖書館

Page 167: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

input network

networkinput

networkinput

networkinput output

network output

network output

Page 168: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Neural Networks

Page 169: with Python · 2020-04-06 · Introduction to Artificial Intelligence with Python. Title: lecture5 Created Date: 4/6/2020 3:23:57 AM ...

Introduction to Artificial Intelligence

with Python