当前位置:网站首页>卷積神經網絡(包含代碼與相應圖解)
卷積神經網絡(包含代碼與相應圖解)
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
卷積層裏的多輸入多輸出通道
边栏推荐
- 【八大排序②】选择排序(选择排序,堆排序)
- Hcip day 14 (MPLS protocol)
- The first "mobile cloud Cup" empty publicity meeting, looking forward to working with developers to create a new world of computing!
- Bubble Sort Graph
- Daily work and study notes
- Exclusive delivery of secret script move disassembly (the first time)
- Mitsubishi PLC FX3U pulse axis jog function block (mc_jog)
- Learning note 24 - multi sensor post fusion technology
- [rust web rokcet Series 1] Hello, world and get, post, put, delete
- [eight sorts ②] select sort (select sort, heap sort)
猜你喜欢
Liteos learning - first knowledge of development environment
[eight sorting ③] quick sorting (dynamic graph deduction Hoare method, digging method, front and back pointer method)
The pain of Xiao Sha
[IVX junior engineer training course 10 papers to get certificates] 09 chat room production
技术大佬准备就绪,话题C位由你决定
Appium inspector can directly locate the WebView page. Does anyone know the principle
电商系统中常见的9大坑,你踩过没?
XMind思维导图
Learning note 24 - multi sensor post fusion technology
[dynamic planning] interval dp:p3205 Chorus
随机推荐
[eight sorts ②] select sort (select sort, heap sort)
Han Zhichao: real time risk control practice of eBay based on graph neural network
How does schedulerx help users solve the problem of distributed task scheduling?
首场“移动云杯”空宣会,期待与开发者一起共创算网新世界!
Global and Chinese market of aircraft MRO software 2022-2028: Research Report on technology, participants, trends, market size and share
Iclr2022 | spherenet and g-spherenet: autoregressive flow model for 3D molecular graph representation and molecular geometry generation
Brief description of grafana of # yyds dry goods inventory # Prometheus
游戏思考15:全区全服和分区分服的思考
什么是商业养老保险?商业养老保险安全靠谱吗?
Data visualization in medical and healthcare applications
BiLSTM-CRF代码实现
Global and Chinese markets for context and location-based services 2022-2028: Research Report on technology, participants, trends, market size and share
Excel search and reference function
Variables and constants of go language foundation
Global and Chinese market of wireless chipsets 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese markets for maritime services 2022-2028: Research Report on technology, participants, trends, market size and share
[IVX junior engineer training course 10 papers] 05 canvas and aircraft war game production
uTools
Load and domcontentloaded in JS
Global and Chinese markets for supply chain strategy and operation consulting 2022-2028: Research Report on technology, participants, trends, market size and share