Classic convolutional neural network LeNet hands-on deep learning v2 pytorch

1. The classic convolutional neural network LeNet

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

2. Code implementation

insert image description here
insert image description here
insert image description here

insert image description here
insert image description here
insert image description here

insert image description here
insert image description here

Compared with the accuracy of MLP, it is almost the same, the accuracy is 80%+
insert image description here

3. Q&A

    1. Why use view instead of reshape? There is no big difference between view and reshape, and reshape will be faster.
    1. MLP data is relatively large and cannot run, so CNN is used. It will be faster if you can use MLP.
    1. The number of output channels increases, which means that more texture information can be recognized.
    1. The pooling layer generally uses max or avg. If it is to identify the type of items, such as cats and dogs, max may be better. If it is a smooth filter, avg will be better.
    1. The Lua language used by LeNet at the time was implemented.
    1. The accuracy of the neural network is generally higher than the threshold satisfied by the user, such as recognizing speech as text, and the user can receive it.
    1. Texture learned by each layer of CNN
      https://poloclub.github.io/cnn-explainer/

insert image description here

reference

https://www.bilibili.com/video/BV1t44y1r7ct?p=1

Guess you like

Origin blog.csdn.net/zgpeace/article/details/124090111