Neural Networks + Convolutional Neural Networks Last Class Global - - PowerPoint PPT Presentation

neural networks convolutional neural networks last class
SMART_READER_LITE
LIVE PREVIEW

Neural Networks + Convolutional Neural Networks Last Class Global - - PowerPoint PPT Presentation

CS4501: Introduction to Computer Vision Neural Networks + Convolutional Neural Networks Last Class Global Features The perceptron model Neural Networks multilayer perceptron model (MLP) Backpropagation Todays Class


slide-1
SLIDE 1

CS4501: Introduction to Computer Vision

Neural Networks + Convolutional Neural Networks

slide-2
SLIDE 2
  • Global Features
  • The perceptron model
  • Neural Networks – multilayer perceptron model (MLP)
  • Backpropagation

Last Class

slide-3
SLIDE 3
  • Neural Networks – multilayer perceptron model (MLP)
  • Backpropagation
  • Convolutional Neural Networks

Today’s Class

slide-4
SLIDE 4

Perceptron Model

Frank Rosenblatt (1957) - Cornell University More: https://en.wikipedia.org/wiki/Perceptron

! " = $1, if * +,",

  • ,./

+ 1 > 0 0,

  • therwise

"; "< "= ">

*

+; +< += +> Activation function

slide-5
SLIDE 5

Perceptron Model

Frank Rosenblatt (1957) - Cornell University More: https://en.wikipedia.org/wiki/Perceptron

! " = $1, if * +,",

  • ,./

+ 1 > 0 0,

  • therwise

"; "< "= ">

*

+; +< += +>

!?

slide-6
SLIDE 6

Perceptron Model

Frank Rosenblatt (1957) - Cornell University More: https://en.wikipedia.org/wiki/Perceptron

! " = $1, if * +,",

  • ,./

+ 1 > 0 0,

  • therwise

"; "< "= ">

*

+; +< += +> Activation function

slide-7
SLIDE 7

Activation Functions

ReLU(x) = max(0, x) Tanh(x) Sigmoid(x) Step(x)

slide-8
SLIDE 8

Pytorch - Perceptron

slide-9
SLIDE 9

Two-layer Multi-layer Perceptron (MLP)

!" !# !$ !%

&

'" '# '$ '%

& & & &

( )" ”hidden" layer (" Loss / Criterion

slide-10
SLIDE 10

Forward pass

!" !# !$ !%

&

'" '# '$ '%

& & & &

( )" ("

*+ = &

  • "+.'+

/ +01

+ 3" !+ = 567896:(*+) =" = &

  • #+!+

/ +01

+ 3# (" = 567896:(=+) >9?? = >((", ( )")

slide-11
SLIDE 11

Backward pass

!" !# !$ !%

&

'" '# '$ '%

& & & &

( )" ("

*+ *,- = * *,- /012304(,-) *+ *!7

89 8:;

=

8 8:; /012304(<-) 89 8= ); 89 8= ); = 8 8= ); +((", (

)") *+ *'7 = ( * *'7 & ?"-7'-

@

  • AB

+ D7) *+ *,- *+ *?"-E = *'7 *?"-E *+ *'7 *+ *!7 = ( * *!7 & ?#-!-

@

  • AB

+ D#) *+ *<" *+ *?#- = *!7 *?#- *+ *!7

GradInputs GradParams

slide-12
SLIDE 12

Pytorch – Two-layer MLP + Regression

slide-13
SLIDE 13

Pytorch – Two-layer MLP + LogSoftmax

# of Hidden Units

slide-14
SLIDE 14

Pytorch – Two-layer MLP + LogSoftmax

LogSoftmax + Negative Likelihood Loss

slide-15
SLIDE 15

Bookmark Opportunity!

slide-16
SLIDE 16

SGD training code (Project 4)

slide-17
SLIDE 17

Convolutional (Neural) Networks

slide-18
SLIDE 18

Convolutional Layer

slide-19
SLIDE 19

Convolutional Layer

slide-20
SLIDE 20

Convolutional Layer

Weights

slide-21
SLIDE 21

Convolutional Layer

4 Weights

slide-22
SLIDE 22

Convolutional Layer

4 1 Weights

slide-23
SLIDE 23

Convolutional Layer (with 4 filters)

Input: 1x224x224 Output: 4x224x224 if zero padding, and stride = 1 weights: 4x1x9x9

slide-24
SLIDE 24

Convolutional Layer (with 4 filters)

Input: 1x224x224 Output: 4x112x112 if zero padding, but stride = 2 weights: 4x1x9x9

slide-25
SLIDE 25

Convolutional Layer in Torch

nInputPlane (e.g. 3 for RGB inputs) nOutputPlane (equals the number of convolutional filters for this layer)

nOutputPlane x

nInputPlane

kW kH

Input Output

slide-26
SLIDE 26

nInputPlane (e.g. 3 for RGB inputs) nOutputPlane (equals the number of convolutional filters for this layer)

nOutputPlane x

nInputPlane

kW kH

Input Output

Convolution2D(nOutputPlane, kW, kH, input_shape = (3, 224, 224), subsample = 2, border_mode = valid)

Convolutional Layer in Keras

slide-27
SLIDE 27

Convolutional Layer in pytorch

in_channels (e.g. 3 for RGB inputs)

  • ut_channels (equals the number of

convolutional filters for this layer)

  • ut_channels x

in_channels

kernel_size kernel_size

Input Output

slide-28
SLIDE 28

Convolutional Network: LeNet

slide-29
SLIDE 29

LeNet in Pytorch

slide-30
SLIDE 30

SpatialMaxPooling Layer

take the max in this neighborhood 8 8 8 8 8

slide-31
SLIDE 31

Convolutional Layers as Matrix Multiplication

https://petewarden.com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

slide-32
SLIDE 32

Convolutional Layers as Matrix Multiplication

https://petewarden.com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

slide-33
SLIDE 33

Convolutional Layers as Matrix Multiplication

https://petewarden.com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

Pros? Cons?

slide-34
SLIDE 34

Questions?

34