当前位置:网站首页>卷積神經網絡(包含代碼與相應圖解)
卷積神經網絡(包含代碼與相應圖解)
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
卷積層裏的多輸入多輸出通道







边栏推荐
- Daily work and study notes
- Error creating bean with name ‘stringRedisTemplate‘ defined in class path re
- Excel search and reference function
- 970 golang realizes the communication between multithreaded server and client
- 笔者更加愿意将产业互联网看成是一个比消费互联网要丰富得多的概念
- Global and Chinese markets for power over Ethernet (POE) solutions 2022-2028: Research Report on technology, participants, trends, market size and share
- Basic usage of shell script
- Infiltration records of CFS shooting range in the fourth phase of the western regions' Dadu Mansion
- XMIND mind map
- MySQL winter vacation self-study 2022 12 (4)
猜你喜欢

Learning note 24 - multi sensor post fusion technology

6-2漏洞利用-ftp不可避免的问题

Keepalived introduction and installation

PLC Analog input analog conversion FB s_ ITR (Mitsubishi FX3U)

Iclr2022 | spherenet and g-spherenet: autoregressive flow model for 3D molecular graph representation and molecular geometry generation

Zak's latest "neural information transmission", with slides and videos
![[conference resources] the Third International Conference on Automation Science and Engineering in 2022 (jcase 2022)](/img/a6/a2afdf9e18255c9171f61bf074998b.png)
[conference resources] the Third International Conference on Automation Science and Engineering in 2022 (jcase 2022)

教你白嫖Amazon rds一年并搭建MySQL云数据库(只需10分钟,真香)

Leetcode, 3 repeatless longest subsequence
![[dynamic planning] interval dp:p3205 Chorus](/img/25/3dc7132e1aaa5c0eca87382692fc12.jpg)
[dynamic planning] interval dp:p3205 Chorus
随机推荐
Daily work and study notes
Global and Chinese markets for food allergens and intolerance tests 2022-2028: Research Report on technology, participants, trends, market size and share
[Chongqing Guangdong education] Tianshui Normal University universe exploration reference
[IVX junior engineer training course 10 papers to get certificates] 09 chat room production
Datawhale 社区黑板报(第1期)
Cookie, session, tooken
Data visualization in medical and healthcare applications
Unity AssetBundle subcontracting
Sql--- related transactions
BiLSTM-CRF代码实现
Excel search and reference function
站在新的角度来看待产业互联网,并且去寻求产业互联网的正确方式和方法
error: . repo/manifests/: contains uncommitted changes
[IVX junior engineer training course 10 papers] 06 database and services
[rust web rokcet Series 1] Hello, world and get, post, put, delete
游戏思考15:全区全服和分区分服的思考
Luogu p1775 stone merger (weakened version)
Comprehensive broadcast of global and Chinese markets 2022-2028: Research Report on technology, participants, trends, market size and share
Bilstm CRF code implementation
8.8.4-PointersOnC-20220215