当前位置:网站首页>卷积神经网络(包含代码与相应图解)
卷积神经网络(包含代码与相应图解)
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
卷积层里的多输入多输出通道







边栏推荐
- 工作中非常重要的测试策略,你大概没注意过吧
- Daily work and study notes
- 学习笔记25--多传感器前融合技术
- Load and domcontentloaded in JS
- 什么是商业养老保险?商业养老保险安全靠谱吗?
- 6-3 vulnerability exploitation SSH environment construction
- Global and Chinese markets of edge AI software 2022-2028: Research Report on technology, participants, trends, market size and share
- Two TVs
- Global and Chinese market of avionics systems 2022-2028: Research Report on technology, participants, trends, market size and share
- XMIND mind map
猜你喜欢

Learn C language from scratch day 025 (maze)

I'll teach you to visit Amazon RDS for a year and build a MySQL cloud database (only 10 minutes, really fragrant)

Leetcode, 3 repeatless longest subsequence

Principle of finding combinatorial number and template code

学习笔记24--多传感器后融合技术

Day 13 of hcip (relevant contents of BGP agreement)

2022年6月国产数据库大事记

6-3 vulnerability exploitation SSH environment construction
![[dynamic planning] interval dp:p3205 Chorus](/img/25/3dc7132e1aaa5c0eca87382692fc12.jpg)
[dynamic planning] interval dp:p3205 Chorus

Advanced skills of testers: a guide to the application of unit test reports
随机推荐
Datawhale community blackboard newspaper (issue 1)
Brief description of grafana of # yyds dry goods inventory # Prometheus
【八大排序③】快速排序(动图演绎Hoare法、挖坑法、前后指针法)
6-3漏洞利用-SSH环境搭建
The concept and application of Cartland number
Study note 2 -- definition and value of high-precision map
Global and Chinese markets for power over Ethernet (POE) solutions 2022-2028: Research Report on technology, participants, trends, market size and share
技术大佬准备就绪,话题C位由你决定
[IVX junior engineer training course 10 papers to get certificates] 01 learn about IVX and complete the New Year greeting card
Creating logical volumes and viewing and modifying attributes for AIX storage management
CEPH buffer yyds dry inventory
Single chip microcomputer -- hlk-w801 transplant NES simulator (III)
Infiltration records of CFS shooting range in the fourth phase of the western regions' Dadu Mansion
Deb file installation
[dynamic planning] interval dp:p3205 Chorus
Just using the way and method of consuming the Internet to land and practice the industrial Internet will not bring long-term development
BiLSTM-CRF代码实现
Finally got byte offer, 25-year-old inexperienced experience in software testing, to share with you
DTL dephossite | prediction method of dephosphorylation sites based on Transfer Learning
How does schedulerx help users solve the problem of distributed task scheduling?