nn.Conv2d中padding结果
时间: 2023-10-16 13:06:11 浏览: 86
pytorch nn.Conv2d()中的padding以及输出大小方式
在使用nn.Conv2d时,padding参数用于控制输入的边界填充。具体来说,padding=1表示在输入的边界周围填充一层值为0的像素。这样做的目的是保持输出的大小与输入相同,因为卷积操作会导致输出尺寸缩小。所以在给定的代码中,conv1 = nn.Conv2d(1,2,kernel_size=3,padding=1)表示在输入的边界周围填充了一层值为0的像素,而conv2 = nn.Conv2d(1,2,kernel_size=3)没有使用padding参数,因此没有进行填充。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [pytorch nn.Conv2d()中的padding以及输出大小方式](https://download.csdn.net/download/weixin_38575118/13759845)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [pytorch之卷积神经网络nn.conv2d](https://download.csdn.net/download/weixin_38580959/14033678)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [pytorch1.0中torch.nn.Conv2d用法详解](https://download.csdn.net/download/weixin_38544625/14858378)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文