neural networks convolutional neural networks last class
play

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


  1. CS4501: Introduction to Computer Vision Neural Networks + Convolutional Neural Networks

  2. Last Class • Global Features • The perceptron model • Neural Networks – multilayer perceptron model (MLP) • Backpropagation

  3. Today’s Class • Neural Networks – multilayer perceptron model (MLP) • Backpropagation • Convolutional Neural Networks

  4. Perceptron Model Frank Rosenblatt (1957) - Cornell University Activation function " ; + ; + < - " < ! " = $1, if * + , " , + 1 > 0 * + = ,./ 0, otherwise " = + > " > More: https://en.wikipedia.org/wiki/Perceptron

  5. Perceptron Model Frank Rosenblatt (1957) - Cornell University !? " ; + ; + < - " < ! " = $1, if * + , " , + 1 > 0 * + = ,./ 0, otherwise " = + > " > More: https://en.wikipedia.org/wiki/Perceptron

  6. Perceptron Model Frank Rosenblatt (1957) - Cornell University Activation function " ; + ; + < - " < ! " = $1, if * + , " , + 1 > 0 * + = ,./ 0, otherwise " = + > " > More: https://en.wikipedia.org/wiki/Perceptron

  7. Activation Functions Sigmoid(x) Step(x) Tanh(x) ReLU(x) = max(0, x)

  8. Pytorch - Perceptron

  9. Two-layer Multi-layer Perceptron (MLP) ”hidden" layer & Loss / Criterion ! " ' " & ! # ' # ( ) " ( " & ! $ ' $ & ! % ' % &

  10. Forward pass / ! + = 567896:(* + ) * + = & - "+. ' + + 3 " +01 / & = " = & - #+ ! + + 3 # +01 ( " = 567896:(= + ) ! " ' " & ! # ' # ( ) " ( " & ! $ ' $ & ! % ' % >9?? = >(( " , ( ) " ) &

  11. Backward pass GradInputs *+ = * /012304(, - ) *+ *+ = ( * @ + D 7 ) *+ & ? "-7 ' - *, - *, - *! 7 *' 7 *' 7 *, - -AB *+ = ( * + D # ) *+ @ & ? #- ! - *! 7 *! 7 *< " & -AB 89 8 89 = 8: ; /012304(< - ) ) ; 8: ; 8= ! " ' " & ! # ' # ( ) " ( " & ! $ ' $ & ! % *+ = *! 7 *+ ' % 89 8 ) ; = ) ; +(( " , ( ) " ) *? #- *? #- *! 7 8= 8= & *+ = *' 7 *+ *? "-E *? "-E *' 7 GradParams

  12. Pytorch – Two-layer MLP + Regression

  13. Pytorch – Two-layer MLP + LogSoftmax # of Hidden Units

  14. Pytorch – Two-layer MLP + LogSoftmax LogSoftmax + Negative Likelihood Loss

  15. Bookmark Opportunity!

  16. SGD training code (Project 4)

  17. Convolutional (Neural) Networks

  18. Convolutional Layer

  19. Convolutional Layer

  20. Convolutional Layer Weights

  21. Convolutional Layer Weights 4

  22. Convolutional Layer Weights 1 4

  23. Convolutional Layer (with 4 filters) weights: 4x1x9x9 Output: 4x224x224 Input: 1x224x224 if zero padding, and stride = 1

  24. Convolutional Layer (with 4 filters) weights: 4x1x9x9 Output: 4x112x112 Input: 1x224x224 if zero padding, but stride = 2

  25. Convolutional Layer in Torch kW Input Output nOutputPlane x kH nInputPlane nOutputPlane (equals the number of convolutional filters for this layer) nInputPlane (e.g. 3 for RGB inputs)

  26. Convolutional Layer in Keras Convolution2D(nOutputPlane, kW, kH, input_shape = (3, 224, 224), subsample = 2, border_mode = valid) kW Input Output nOutputPlane x kH nInputPlane nOutputPlane (equals the number of convolutional filters for this layer) nInputPlane (e.g. 3 for RGB inputs)

  27. Convolutional Layer in pytorch kernel_size Input Output out_channels x kernel_size in_channels out_channels (equals the number of convolutional filters for this layer) in_channels (e.g. 3 for RGB inputs)

  28. Convolutional Network: LeNet

  29. LeNet in Pytorch

  30. SpatialMaxPooling Layer take the max in this neighborhood 8 8 8 8 8

  31. Convolutional Layers as Matrix Multiplication https://petewarden.com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

  32. Convolutional Layers as Matrix Multiplication https://petewarden.com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

  33. Convolutional Layers as Matrix Multiplication Pros? Cons? https://petewarden.com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

  34. Questions? 34

Recommend


More recommend