当前位置:网站首页>卷积神经网络(包含代码与相应图解)
卷积神经网络(包含代码与相应图解)
2022-07-02 01:18: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代码实现
- Error creating bean with name ‘stringRedisTemplate‘ defined in class path re
- Develop a simple login logic based on SSM
- [eight sorts ①] insert sort (direct insert sort, Hill sort)
- 6-3漏洞利用-SSH环境搭建
- 970 golang realizes the communication between multithreaded server and client
- [IVX junior engineer training course 10 papers] 02 numerical binding and adaptive website production
- The 8-year salary change of testers makes netizens envy it: you pay me one year's salary per month
- 学习笔记2--高精度地图定义及价值
- Minimize the error
猜你喜欢

Hcip day 14 (MPLS protocol)
![[dynamic planning] interval dp:p3205 Chorus](/img/25/3dc7132e1aaa5c0eca87382692fc12.jpg)
[dynamic planning] interval dp:p3205 Chorus

How can I batch produce the same title for the video?
![[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

GL Studio 5 安装与体验

How does schedulerx help users solve the problem of distributed task scheduling?

技术大佬准备就绪,话题C位由你决定

Finally got byte offer, 25-year-old inexperienced experience in software testing, to share with you

GL Studio 5 installation and experience

Datawhale 社区黑板报(第1期)
随机推荐
How to reflect and solve the problem of bird flight? Why are planes afraid of birds?
Exclusive delivery of secret script move disassembly (the first time)
学习笔记3--高精度地图关键技术(上)
What is commercial endowment insurance? Is commercial endowment insurance safe?
Global and Chinese markets for context and location-based services 2022-2028: Research Report on technology, participants, trends, market size and share
[eight sorts ①] insert sort (direct insert sort, Hill sort)
Look at the industrial Internet from a new perspective and seek the correct ways and methods of industrial Internet
8.8.4-PointersOnC-20220215
Global and Chinese markets for the application of artificial intelligence in security, public security and national security 2022-2028: Research Report on technology, participants, trends, market size
6-3 vulnerability exploitation SSH environment construction
Data visualization in medical and healthcare applications
The pain of Xiao Sha
Day 13 of hcip (relevant contents of BGP agreement)
Leetcode 45 Jumping game II (2022.02.14)
GL Studio 5 安装与体验
DTL dephossite | prediction method of dephosphorylation sites based on Transfer Learning
[IVX junior engineer training course 10 papers] 04 canvas and a group photo of IVX and me
970 golang realizes the communication between multithreaded server and client
Evolution of Himalayan self-developed gateway architecture
Study note 2 -- definition and value of high-precision map