当前位置:网站首页>The calculation of stripe, kernel and padding in CNN
The calculation of stripe, kernel and padding in CNN
2022-07-03 03:14:00 【Mr. paidaxing C】
During the construction of convolution network , Encountered a confusion , That is how to calculate the output size of the network according to some super parameters of convolution , Convolution size change
In order to make the calculation process more intuitive , Define the following parameters
Definition ![]()
Definition
Definition ![]()
Enter the dimension as ![]()
The output size is ![]()
Then the convolution size changes to 
for example , Input is 28 , Convolution kernels for 3*3 , step stride=1,padding=1, From the above formula, the new output is 
Output remains 28 unchanged
But there must be a situation that cannot be divisible , stay PyTorch Can be seen in


Pooling is similar to

Shape:
- Input: :math:`(N, C, H_{in}, W_{in})`
- Output: :math:`(N, C, H_{out}, W_{out})`, where
.. math::
H_{out} = \left\lfloor\frac{H_{in} + 2 * \text{padding[0]} - \text{dilation[0]}
\times (\text{kernel\_size[0]} - 1) - 1}{\text{stride[0]}} + 1\right\rfloor
.. math::
W_{out} = \left\lfloor\frac{W_{in} + 2 * \text{padding[1]} - \text{dilation[1]}
\times (\text{kernel\_size[1]} - 1) - 1}{\text{stride[1]}} + 1\right\rfloorstay PyTorch For conditions that cannot be divided, the default is to round down , You can choose to round up
边栏推荐
- The idea cannot be loaded, and the market solution can be applied (pro test)
- MySql实战45讲【事务隔离】
- TCP 三次握手和四次挥手机制,TCP为什么要三次握手和四次挥手,TCP 连接建立失败处理机制
- Notifydatasetchanged not applicable to recyclerview - notifydatasetchanged not working on recyclerview
- 后管中编辑与预览获取表单的值写法
- I2C subsystem (III): I2C driver
- MySQL practice 45 lecture [row lock]
- Variable declarations following if statements
- open file in 'w' mode: IOError: [Errno 2] No such file or directory
- 力扣------网格中的最小路径代价
猜你喜欢
随机推荐
Anhui University | small target tracking: large-scale data sets and baselines
Andwhere multiple or query ORM conditions in yii2
C# WebRequest POST模式 ,基于“Basic Auth”口令认证模式,使用multipart/form-data方式上传文件及提交其他数据
[C language] MD5 encryption for account password
I2C 子系统(三):I2C Driver
为什么线程崩溃不会导致 JVM 崩溃
Force deduction ----- the minimum path cost in the grid
Basic information of Promethus (I)
MySQL practice 45 [SQL query and update execution process]
PHP constructor with parameters - PHP constructor with a parameter
Left connection, inner connection
二进制流转换成字节数组
用docker 连接mysql的过程
MySQL practice 45 [global lock and table lock]
com. fasterxml. jackson. databind. Exc.invalidformatexception problem
From C to capable -- use the pointer as a function parameter to find out whether the string is a palindrome character
[algebraic structure] group (definition of group | basic properties of group | proof method of group | commutative group)
[mathematical logic] predicate logic (individual word | individual domain | predicate | full name quantifier | existence quantifier | predicate formula | exercise)
[error record] the parameter 'can't have a value of' null 'because of its type, but the im
C#通用接口调用








