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







边栏推荐
- 什么是商业养老保险?商业养老保险安全靠谱吗?
- Edge computing accelerates live video scenes: clearer, smoother, and more real-time
- 游戏思考15:全区全服和分区分服的思考
- The concept and application of Cartland number
- DTL dephossite | prediction method of dephosphorylation sites based on Transfer Learning
- 学习笔记2--高精度地图定义及价值
- Bilstm CRF code implementation
- The author is more willing to regard industrial Internet as a concept much richer than consumer Internet
- Unity AssetBundle subcontracting
- Design and control of multi rotor aircraft (VII) -- sensor calibration and measurement model
猜你喜欢

Design and control of multi rotor aircraft (VII) -- sensor calibration and measurement model
![[IVX junior engineer training course 10 papers] 06 database and services](/img/68/967566fc2f1d0b93ecd78bdb208b64.jpg)
[IVX junior engineer training course 10 papers] 06 database and services

浅浅了解Servlet

卷积神经网络(包含代码与相应图解)

6-3 vulnerability exploitation SSH environment construction
![[IVX junior engineer training course 10 papers] 04 canvas and a group photo of IVX and me](/img/b8/31a498c89cf96567640677e859df4e.jpg)
[IVX junior engineer training course 10 papers] 04 canvas and a group photo of IVX and me
![[IVX junior engineer training course 10 papers to get certificates] 09 chat room production](/img/a8/25215e74162b7ab3f29df65681932b.jpg)
[IVX junior engineer training course 10 papers to get certificates] 09 chat room production

Hcip day 14 (MPLS protocol)

教你白嫖Amazon rds一年并搭建MySQL云数据库(只需10分钟,真香)
![[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
随机推荐
Global and Chinese market of collaborative applications 2022-2028: Research Report on technology, participants, trends, market size and share
Basic number theory -- Gauss elimination
"C zero foundation introduction hundred knowledge hundred examples" (73) anonymous function -- lambda expression
Load and domcontentloaded in JS
Since I understand the idea of dynamic planning, I have opened the door to a new world
[eight sorts ①] insert sort (direct insert sort, Hill sort)
BiLSTM-CRF代码实现
Evolution of Himalayan self-developed gateway architecture
学习笔记25--多传感器前融合技术
PLC Analog input analog conversion FB s_ ITR (Mitsubishi FX3U)
Global and Chinese markets for context and location-based services 2022-2028: Research Report on technology, participants, trends, market size and share
Edge extraction edges based on Halcon learning_ image. Hdev routine
Single chip microcomputer -- hlk-w801 transplant NES simulator (III)
Brief description of grafana of # yyds dry goods inventory # Prometheus
A problem about function template specialization
Global and Chinese market of ancillary software 2022-2028: Research Report on technology, participants, trends, market size and share
Error creating bean with name ‘stringRedisTemplate‘ defined in class path re
2022年6月国产数据库大事记
Global and Chinese markets of edge AI software 2022-2028: Research Report on technology, participants, trends, market size and share
Look at the industrial Internet from a new perspective and seek the correct ways and methods of industrial Internet