Dropout drop method hands-on deep learning v2 pytorch

1. Definition of Dropout

Dropout is only used when Traning, because dropout is similar to regularization.
Commonly used in the hidden layer of a multilayer perceptron.
In predict, it is not needed, because predict is a stable result.
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. Dropout is implemented from scratch

Matrix multiplication, high efficiency
insert image description here

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

2. Simple implementation of pytorch

insert image description here
insert image description here

refer to

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

Guess you like

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