当前位置:网站首页>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
边栏推荐
- Pat class B "1104 forever" DFS optimization idea
- C # general interface call
- Edit and preview in the back pipe to get the value writing method of the form
- Unity3d RPG implementation (medium)
- docker安装redis
- [combinatorics] number of solutions of indefinite equations (number of combinations of multiple sets R | number of non negative integer solutions of indefinite equations | number of integer solutions
- Le processus de connexion mysql avec docker
- 模糊查询时报错Parameter index out of range (1 > number of parameters, which is 0)
- 别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!
- I2C subsystem (III): I2C driver
猜你喜欢

Installation and use of memory leak tool VLD

Three. JS local environment setup

I2C 子系統(四):I2C debug

idea 加载不了应用市场解决办法(亲测)

Nasvit: neural architecture search of efficient visual converter with gradient conflict perception hypernetwork training

Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception

The idea cannot be loaded, and the market solution can be applied (pro test)

Le processus de connexion mysql avec docker

函数栈帧的创建与销毁

TCP handshake three times and wave four times. Why does TCP need handshake three times and wave four times? TCP connection establishes a failure processing mechanism
随机推荐
Idea format code idea set shortcut key format code
Update and return document in mongodb - update and return document in mongodb
Yolov5 project based on QT
I2C subsystem (III): I2C driver
open file in 'w' mode: IOError: [Errno 2] No such file or directory
L'index des paramètres d'erreur est sorti de la plage pour les requêtes floues (1 > Nombre de paramètres, qui est 0)
[C language] MD5 encryption for account password
labelimg生成的xml文件转换为voc格式
【PyG】理解MessagePassing过程,GCN demo详解
idea 加载不了应用市场解决办法(亲测)
[shutter] monitor the transparency gradient of the scrolling action control component (remove the blank of the top status bar | frame layout component | transparency component | monitor the scrolling
Use of El tree search method
Pat class B common function Usage Summary
解决高並發下System.currentTimeMillis卡頓
一文带你了解 ZigBee
内存泄漏工具VLD安装及使用
Le processus de connexion mysql avec docker
TCP 三次握手和四次挥手机制,TCP为什么要三次握手和四次挥手,TCP 连接建立失败处理机制
Do you really understand relays?
The idea setting code is in UTF-8 idea Properties configuration file Chinese garbled