lecture 6 convolutional nn

Lecture 6: Convolutional NN Princeton University COS 495 - PowerPoint PPT Presentation

Deep Learning Basics Lecture 6: Convolutional NN Princeton University COS 495 Instructor: Yingyu Liang Review: convolutional layers Convolution: two dimensional case Input Kernel/filter a b c d w x e f g h y z i j k l wa + bx


  1. Deep Learning Basics Lecture 6: Convolutional NN Princeton University COS 495 Instructor: Yingyu Liang

  2. Review: convolutional layers

  3. Convolution: two dimensional case Input Kernel/filter a b c d w x e f g h y z i j k l wa + bx + bw + cx + ey + fz fy + gz Feature map

  4. Convolutional layers the same weight shared for all output nodes 𝑛 output nodes 𝑙 kernel size π‘œ input nodes Figure from Deep Learning, by Goodfellow, Bengio, and Courville

  5. Terminology Figure from Deep Learning, by Goodfellow, Bengio, and Courville

  6. Case study: LeNet-5

  7. LeNet-5 β€’ Proposed in β€œ Gradient-based learning applied to document recognition ” , by Yann LeCun, Leon Bottou, Yoshua Bengio and Patrick Haffner, in Proceedings of the IEEE, 1998

  8. LeNet-5 β€’ Proposed in β€œ Gradient-based learning applied to document recognition ” , by Yann LeCun, Leon Bottou, Yoshua Bengio and Patrick Haffner, in Proceedings of the IEEE, 1998 β€’ Apply convolution on 2D images (MNIST) and use backpropagation

  9. LeNet-5 β€’ Proposed in β€œ Gradient-based learning applied to document recognition ” , by Yann LeCun, Leon Bottou, Yoshua Bengio and Patrick Haffner, in Proceedings of the IEEE, 1998 β€’ Apply convolution on 2D images (MNIST) and use backpropagation β€’ Structure: 2 convolutional layers (with pooling) + 3 fully connected layers β€’ Input size: 32x32x1 β€’ Convolution kernel size: 5x5 β€’ Pooling: 2x2

  10. LeNet-5 Figure from Gradient-based learning applied to document recognition, by Y. LeCun, L. Bottou, Y. Bengio and P. Haffner

  11. LeNet-5 Figure from Gradient-based learning applied to document recognition, by Y. LeCun, L. Bottou, Y. Bengio and P. Haffner

  12. LeNet-5 Filter: 5x5, stride: 1x1, #filters: 6 Figure from Gradient-based learning applied to document recognition, by Y. LeCun, L. Bottou, Y. Bengio and P. Haffner

  13. LeNet-5 Pooling: 2x2, stride: 2 Figure from Gradient-based learning applied to document recognition, by Y. LeCun, L. Bottou, Y. Bengio and P. Haffner

  14. LeNet-5 Filter: 5x5x6, stride: 1x1, #filters: 16 Figure from Gradient-based learning applied to document recognition, by Y. LeCun, L. Bottou, Y. Bengio and P. Haffner

  15. LeNet-5 Pooling: 2x2, stride: 2 Figure from Gradient-based learning applied to document recognition, by Y. LeCun, L. Bottou, Y. Bengio and P. Haffner

  16. LeNet-5 Weight matrix: 400x120 Figure from Gradient-based learning applied to document recognition, by Y. LeCun, L. Bottou, Y. Bengio and P. Haffner

  17. Weight matrix: 84x10 LeNet-5 Weight matrix: 120x84 Figure from Gradient-based learning applied to document recognition, by Y. LeCun, L. Bottou, Y. Bengio and P. Haffner

  18. Software platforms for CNN Updated in April 2016; checked more recent ones online

  19. Platform: Marvin (marvin.is)

  20. Platform: Marvin by

  21. LeNet in Marvin: convolutional layer

  22. LeNet in Marvin: pooling layer

  23. LeNet in Marvin: fully connected layer

  24. Platform: Caffe (caffe.berkeleyvision.org)

  25. LeNet in Caffe

  26. Platform: Tensorflow (tensorflow.org)

  27. Platform: Tensorflow (tensorflow.org)

  28. Platform: Tensorflow (tensorflow.org)

  29. Others β€’ Theano – CPU/GPU symbolic expression compiler in python (from MILA lab at University of Montreal) β€’ Torch – provides a Matlab-like environment for state-of-the-art machine learning algorithms in lua β€’ Lasagne - Lasagne is a lightweight library to build and train neural networks in Theano β€’ See: http://deeplearning.net/software_links/

  30. Optimization: momentum

  31. Basic algorithms β€’ Minimize the (regularized) empirical loss 1 ΰ·  π‘œ π‘œ Οƒ 𝑒=1 𝑀 𝑆 πœ„ = π‘š(πœ„, 𝑦 𝑒 , 𝑧 𝑒 ) + 𝑆(πœ„) where the hypothesis is parametrized by πœ„ β€’ Gradient descent πœ„ 𝑒+1 = πœ„ 𝑒 βˆ’ πœƒ 𝑒 𝛼෠ 𝑀 𝑆 πœ„ 𝑒

  32. Mini-batch stochastic gradient descent β€’ Instead of one data point, work with a small batch of 𝑐 points (𝑦 𝑒𝑐+1, 𝑧 𝑒𝑐+1 ) ,…, (𝑦 𝑒𝑐+𝑐, 𝑧 𝑒𝑐+𝑐 ) β€’ Update rule 1 πœ„ 𝑒+1 = πœ„ 𝑒 βˆ’ πœƒ 𝑒 𝛼 𝑐 ෍ π‘š πœ„ 𝑒 , 𝑦 𝑒𝑐+𝑗 , 𝑧 𝑒𝑐+𝑗 + 𝑆(πœ„ 𝑒 ) 1≀𝑗≀𝑐

  33. Momentum β€’ Drawback of SGD: can be slow when gradient is small β€’ Observation: when the gradient is consistent across consecutive steps, can take larger steps β€’ Metaphor: rolling marble ball on gentle slope

  34. Momentum Contour: loss function Path: SGD with momentum Arrow: stochastic gradient Figure from Deep Learning, by Goodfellow, Bengio, and Courville

  35. Momentum β€’ work with a small batch of 𝑐 points (𝑦 𝑒𝑐+1, 𝑧 𝑒𝑐+1 ) ,…, (𝑦 𝑒𝑐+𝑐, 𝑧 𝑒𝑐+𝑐 ) β€’ Keep a momentum variable 𝑀 𝑒 , and set a decay rate 𝛽 β€’ Update rule 1 𝑀 𝑒 = 𝛽𝑀 π‘’βˆ’1 βˆ’ πœƒ 𝑒 𝛼 𝑐 ෍ π‘š πœ„ 𝑒 , 𝑦 𝑒𝑐+𝑗 , 𝑧 𝑒𝑐+𝑗 + 𝑆(πœ„ 𝑒 ) 1≀𝑗≀𝑐 πœ„ 𝑒+1 = πœ„ 𝑒 + 𝑀 𝑒

  36. Momentum β€’ Keep a momentum variable 𝑀 𝑒 , and set a decay rate 𝛽 β€’ Update rule 1 𝑀 𝑒 = 𝛽𝑀 π‘’βˆ’1 βˆ’ πœƒ 𝑒 𝛼 𝑐 ෍ π‘š πœ„ 𝑒 , 𝑦 𝑒𝑐+𝑗 , 𝑧 𝑒𝑐+𝑗 + 𝑆(πœ„ 𝑒 ) 1≀𝑗≀𝑐 πœ„ 𝑒+1 = πœ„ 𝑒 + 𝑀 𝑒 β€’ Practical guide: 𝛽 is set to 0.5 until the initial learning stabilizes and then is increased to 0.9 or higher.

Recommend


More recommend