当前位置:网站首页>卷積神經網絡(包含代碼與相應圖解)
卷積神經網絡(包含代碼與相應圖解)
2022-07-02 01:20:00 【小帥吖】
1.卷積神經網絡中的相關計算問題
(1)單純的二維卷積

(2)加入填充(padding)
注:下圖中的ph為在代碼中設置的padding值的二倍
(3)加入填充(padding)和步幅(stride)

卷積核和過濾器(fliter)是有區別的,卷積核是二維概念,過濾器由一個或者多個卷積核拼成。
2.通過一個實例學習卷積神經網絡的構建

通過以下代碼構建上圖的神經網絡
class ConvNet(nn.Module):
def __init__(self):
super(ConvNet, self).__init__()
self.layer1 = nn.Sequential(
nn.Conv2d(1, 32, kernel_size=5, stride=1, padding=2),
nn.ReLU(),
nn.MaxPool2d(kernel_size=2, stride=2))
self.layer2 = nn.Sequential(
nn.Conv2d(32, 64, kernel_size=5, stride=1, padding=2),
nn.ReLU(),
nn.MaxPool2d(kernel_size=2, stride=2))
self.drop_out = nn.Dropout()
self.fc1 = nn.Linear(7 * 7 * 64, 1000)
self.fc2 = nn.Linear(1000, 10)
def forward(self, x):
out = self.layer1(x)
out = self.layer2(out)
out = out.reshape(out.size(0), -1)
out = self.drop_out(out)
out = self.fc1(out)
out = self.fc2(out)
return out
3.卷積神經網絡相關內容








卷積層裏的填充和步幅
當卷積核比較大或者經過多次卷積後圖像的過小此時考慮通過填充操作來緩解


當輸入圖片大小比較大時,在小的卷積核下要經過很多層計算才能實現





8-5+1+4=8
8-3+1+2=8
8 / 2 = 4
(8-3+0+3)/3=2
(8-5+2+4)/4=2
卷積層裏的多輸入多輸出通道







边栏推荐
- BiLSTM-CRF代码实现
- Datawhale 社区黑板报(第1期)
- 教你白嫖Amazon rds一年并搭建MySQL云数据库(只需10分钟,真香)
- 首场“移动云杯”空宣会,期待与开发者一起共创算网新世界!
- CEPH buffer yyds dry inventory
- 学习笔记25--多传感器前融合技术
- Single chip microcomputer -- hlk-w801 transplant NES simulator (III)
- Exclusive delivery of secret script move disassembly (the first time)
- Global and Chinese markets for food allergens and intolerance tests 2022-2028: Research Report on technology, participants, trends, market size and share
- How does schedulerx help users solve the problem of distributed task scheduling?
猜你喜欢

Hcip day 14 (MPLS protocol)

Day 13 of hcip (relevant contents of BGP agreement)

Sql--- related transactions
![[IVX junior engineer training course 10 papers to get certificates] 0708 news page production](/img/ad/a1cb672d2913b6befd6d8779c993ec.jpg)
[IVX junior engineer training course 10 papers to get certificates] 0708 news page production

电商系统中常见的9大坑,你踩过没?

GL Studio 5 安装与体验

【图像增强】基于Frangi滤波器实现血管图像增强附matlab代码

【八大排序③】快速排序(动图演绎Hoare法、挖坑法、前后指针法)

LeetCode、3无重复最长子序列

卷积神经网络(包含代码与相应图解)
随机推荐
Global and Chinese markets for context and location-based services 2022-2028: Research Report on technology, participants, trends, market size and share
Learning notes 25 - multi sensor front fusion technology
游戏思考15:全区全服和分区分服的思考
6-3漏洞利用-SSH环境搭建
Global and Chinese market of ancillary software 2022-2028: Research Report on technology, participants, trends, market size and share
Creating logical volumes and viewing and modifying attributes for AIX storage management
Basic usage of three JS high-order functions --filter---map---reduce
What are the differences between software testers with a monthly salary of 7K and 25K? Leaders look up to you when they master it
Global and Chinese market of picture archiving and communication system (PACS) 2022-2028: Research Report on technology, participants, trends, market size and share
About asp Net core uses a small detail of datetime date type parameter
Appium inspector can directly locate the WebView page. Does anyone know the principle
How to determine whether the current script is in the node environment or the browser environment?
We should make clear the branch prediction
[IVX junior engineer training course 10 papers to get certificates] 03 events and guessing numbers games
Cat Party (Easy Edition)
Single chip microcomputer -- hlk-w801 transplant NES simulator (III)
Bubble Sort Graph
[IVX junior engineer training course 10 papers to get certificates] 01 learn about IVX and complete the New Year greeting card
CEPH buffer yyds dry inventory
[IVX junior engineer training course 10 papers] 04 canvas and a group photo of IVX and me