deep learning and tensorflow - pavia€¦ · deep learning and tensorflow–episode 1 [1] ......

109
[1] Deep Learning and TensorFlow – Episode 1 Deep Learning and TensorFlow Episode 1 Artificial Neural Networks Università degli Studi di Pavia

Upload: others

Post on 20-May-2020

27 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[1]Deep Learning and TensorFlow – Episode 1

Deep Learningand TensorFlowEpisode 1Artificial Neural Networks

Università degli Studi di Pavia

Page 2: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[2]Deep Learning and TensorFlow – Episode 1

Main References for the This Course

Page 3: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[3]Deep Learning and TensorFlow – Episode 1

Google Cloud Platform Coupon

Page 4: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[4]Deep Learning and TensorFlow – Episode 1

Prologue:"Deep Learning"?

Page 5: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[5]Deep Learning and TensorFlow – Episode 1

Deep Learning in the Artificial Intelligence Cosmos

Page 6: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[6]Deep Learning and TensorFlow – Episode 1

AI strikes back?

Page 7: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[7]Deep Learning and TensorFlow – Episode 1

Artificial Perception

Page 8: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[8]Deep Learning and TensorFlow – Episode 1

Artificial Neural NetworksThe Origins

Page 9: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[9]Deep Learning and TensorFlow – Episode 1

Emulation or simulation? Connectionism

Page 10: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[10]Deep Learning and TensorFlow – Episode 1

Artificial Neural Network

Page 11: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[11]Deep Learning and TensorFlow – Episode 1

Function approximation:Linear Combination

Page 12: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[12]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

d

Page 13: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[13]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 14: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[14]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 15: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[15]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 16: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[16]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 17: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[17]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 18: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[18]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 19: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[19]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 20: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[20]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 21: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[21]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 22: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[22]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 23: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[23]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 24: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[24]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 25: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[25]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 26: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[26]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 27: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[27]Deep Learning and TensorFlow – Episode 1

Function Approximation: linear combination

Page 28: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[28]Deep Learning and TensorFlow – Episode 1

Function approximation:Feed-Forward Neural Network

Page 29: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[29]Deep Learning and TensorFlow – Episode 1

Feed-Forward Neural Network

h d

Page 30: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[30]Deep Learning and TensorFlow – Episode 1

Feed-Forward Neural Network

Page 31: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[31]Deep Learning and TensorFlow – Episode 1

Feed-Forward Neural Network

Page 32: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[32]Deep Learning and TensorFlow – Episode 1

Feed-Forward Neural Network

Page 33: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[33]Deep Learning and TensorFlow – Episode 1

Feed-Forward Neural Network

Page 34: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[34]Deep Learning and TensorFlow – Episode 1

Universality of FF Neural Networks

Page 35: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[35]Deep Learning and TensorFlow – Episode 1

x W

Universality of FF Neural Networks

Page 36: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[36]Deep Learning and TensorFlow – Episode 1

i j

Universality of FF Neural Networks

Page 37: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[37]Deep Learning and TensorFlow – Episode 1

LearningFeed-Forward Neural Networks

Page 38: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[38]Deep Learning and TensorFlow – Episode 1

Learning with FF Neural Networks

Page 39: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[39]Deep Learning and TensorFlow – Episode 1

Learning with FF Neural Networks

Page 40: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[40]Deep Learning and TensorFlow – Episode 1

Gradient Descent (GD): intuition

D

Page 41: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[41]Deep Learning and TensorFlow – Episode 1

Gradient Descent (GD): convergence

Page 42: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[42]Deep Learning and TensorFlow – Episode 1

Gradient Descent (GD): practicalities

Page 43: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[43]Deep Learning and TensorFlow – Episode 1

Gradient Descent (GD): practicalities

Page 44: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[44]Deep Learning and TensorFlow – Episode 1

Gradient Descent for FF Neural Networks

Page 45: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[45]Deep Learning and TensorFlow – Episode 1

Gradient Descent for FF Neural Networks

Page 46: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[46]Deep Learning and TensorFlow – Episode 1

Computing Gradients

Page 47: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[47]Deep Learning and TensorFlow – Episode 1

Flow Graphs

Page 48: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[48]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 49: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[49]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 50: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[50]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 51: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[51]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 52: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[52]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 53: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[53]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 54: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[54]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 55: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[55]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 56: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[56]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 57: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[57]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 58: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[58]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 59: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[59]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 60: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[60]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 61: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[61]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 62: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[62]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 63: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[63]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 64: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[64]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 65: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[65]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 66: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[66]Deep Learning and TensorFlow – Episode 1

An aside: Flow Graph

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 67: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[67]Deep Learning and TensorFlow – Episode 1

Differentiation ofFlow Graphs

Page 68: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[68]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 69: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[69]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 70: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[70]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L

sub

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

Page 71: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[71]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

mul

2

sqr

Page 72: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[72]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

mul

2

sqr

Page 73: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[73]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

mul

2

sqr

Page 74: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[74]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

mul

2

sqr

Page 75: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[75]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

mul

2

mul

1

Page 76: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[76]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

wmul

0.5

sum

abs

sum

b dot

W x

mul

2

mul

1 mul

1

Page 77: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[77]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

w

dot

mul

0.5

sum

abs

sum

b dot

W x

mul

2

mul

1 mul

1

Page 78: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[78]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

w

dot

mul

0.5

sum

abs

sum

b dot

W x

mul

2

mul

1 mul

1

mul

0.5

Page 79: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[79]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

w

dot

mul

0.5

sum

abs

sum

b dot

W x

mul

2

mul

1 mul

1

mul

0.5 sum

mul

1

mul

1

Page 80: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[80]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

w

dot

mul

0.5

sum

abs

div

sum

b dot

W x

mul

2

mul

1 mul

1

mul

0.5 sum

mul

1

dot

mul

1

Page 81: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[81]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

w

dot

mul

0.5

sum

abs

div

sum

b dot

W x

mul

2

mul

1 mul

1

mul

0.5 sum

mul

1mul

dot

1

mul

1

Page 82: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[82]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

w

dot

mul

0.5

sum

abs

div

sum

b dot

W x

mul

2

mul

1 mul

1

mul

0.5 sum

mul

1mul

dot

1

mul

1

Page 83: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[83]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

w

dot

mul

0.5

sum

abs

div

sum

b dot

W x

mul

2

mul

1 mul

1

mul

0.5 sum

mul

1mul

dot

1

mul

1

Page 84: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[84]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

w

dot

mul

0.5

sum

abs

div

sum

b dot

W x

mul

2

mul

1 mul

1

mul

0.5 sum

mul

1mul

dot

1

mul

1

Page 85: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[85]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

w

dot

mul

0.5

sum

abs

div

sum

b dot

W x

mul

2

mul

1 mul

1

mul

0.5 sum

mul

1mul

dot

1

mul

1

Page 86: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[86]Deep Learning and TensorFlow – Episode 1

Computing Gradients

sqr

L grad L

sub

mul

y sum

b

dot

w

dot

mul

0.5

sum

abs

div

sum

b dot

W x

mul

2

mul

1 mul

1

mul

0.5 sum

mul

1mul

dot

1

mul

1

Page 87: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[87]Deep Learning and TensorFlow – Episode 1

LearningFeed-Forward Neural Networks

(contd.)

Page 88: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[88]Deep Learning and TensorFlow – Episode 1

Function Approximation: FF Neural Networks

Page 89: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[89]Deep Learning and TensorFlow – Episode 1

Function Approximation: FF Neural Networks

Page 90: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[90]Deep Learning and TensorFlow – Episode 1

Stochastic Gradient Descent for FF Neural Networks

Page 91: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[91]Deep Learning and TensorFlow – Episode 1

Stochastic Gradient Descent (SGD): convergence

Page 92: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[92]Deep Learning and TensorFlow – Episode 1

Speed of Convergence

Page 93: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[93]Deep Learning and TensorFlow – Episode 1

Mini-batch Gradient Descent for FF Neural Networks

Page 94: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[94]Deep Learning and TensorFlow – Episode 1

Qualitative comparison of GD methods

Page 95: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[95]Deep Learning and TensorFlow – Episode 1

(Mini) Batchesin Matrix Form

Page 96: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[96]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

Page 97: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[97]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

Page 98: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[98]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

N

Page 99: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[99]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

N

Page 100: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[100]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

Page 101: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[101]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

Page 102: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[102]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

Page 103: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[103]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

b

Page 104: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[104]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

b

Page 105: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[105]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

b

Page 106: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[106]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

b

Page 107: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[107]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

Page 108: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[108]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms

Page 109: Deep Learning and TensorFlow - Pavia€¦ · Deep Learning and TensorFlow–Episode 1 [1] ... Artificial Neural Networks Università degli Studi di Pavia. Deep Learning and TensorFlow–Episode

[109]Deep Learning and TensorFlow – Episode 1

More on Matrix Forms