Convolutional neural network image dimensions and parameters calculated

I believe that many students engage in machine learning time, every step of convolution after pooling, the picture size and the size is very confused and do not know how to calculate.
Here, I have to share several formulas to help you understand. I do not understand the welcome message below.

1, a convolution layer (Conv Layer) output tensor (image) in size

It is defined as follows:

O = output image size.

I = the size of the input image.

K = the convolution kernel size layer

N = number of cores

S = moving step

P = Number of padding

Output image size is calculated as follows:
Here Insert Picture Description

2, pooled layer (MaxPool Layer) output tensor (image) in size

It is defined as follows:

O = output image size.

I = the size of the input image.

S = moving step

PS = pool size layer

Output image size is calculated as follows:
Here Insert Picture Description
With the formula of Appeal later, I specifically went to the station b watched the video, after the set into the formula, and we find the same understanding.
Here Insert Picture Description

3, the whole connecting layer (Fully Connected Layer) output tensor (image) in size

Layer fully connected the output vector length equal to the number of neurons.
Fully connected layer has its own weight, the weight is the number of parameters of
Here Insert Picture Description
number is calculated as parent
Here Insert Picture Description

Published 76 original articles · won praise 14 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_36444039/article/details/103984502