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







边栏推荐
- 6-2漏洞利用-ftp不可避免的问题
- MySQL application day02
- 【八大排序④】归并排序、不基于比较的排序(计数排序、基数排序、桶排序)
- We should make clear the branch prediction
- Part 29 supplement (XXIX) basis of ECMAScript
- cookie、session、tooken
- Entrepreneurship is a little risky. Read the data and do a business analysis
- Advanced skills of testers: a guide to the application of unit test reports
- Principle of finding combinatorial number and template code
- 【八大排序②】选择排序(选择排序,堆排序)
猜你喜欢

SAP ui5 beginner tutorial XXI - trial version of custom formatter of SAP ui5

Datawhale 社区黑板报(第1期)

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

Minimize the error

Single chip microcomputer -- hlk-w801 transplant NES simulator (III)

Review notes of compilation principles
![[IVX junior engineer training course 10 papers] 02 numerical binding and adaptive website production](/img/b7/aecb815ca9545981563a1e16cfa19e.jpg)
[IVX junior engineer training course 10 papers] 02 numerical binding and adaptive website production

MySQL application day02

Leetcode, 3 repeatless longest subsequence

测试人进阶技能:单元测试报告应用指南
随机推荐
Load and domcontentloaded in JS
Global and Chinese market of picture archiving and communication system (PACS) 2022-2028: Research Report on technology, participants, trends, market size and share
LeetCode、3无重复最长子序列
Hcip day 14 (MPLS protocol)
Han Zhichao: real time risk control practice of eBay based on graph neural network
Brief description of grafana of # yyds dry goods inventory # Prometheus
Global and Chinese markets for power over Ethernet (POE) solutions 2022-2028: Research Report on technology, participants, trends, market size and share
gradle
[conference resources] the Third International Conference on Automation Science and Engineering in 2022 (jcase 2022)
Mitsubishi PLC FX3U pulse axis jog function block (mc_jog)
Docker安装Oracle_11g
[dynamic planning] interval dp:p3205 Chorus
Zak's latest "neural information transmission", with slides and videos
【八大排序④】归并排序、不基于比较的排序(计数排序、基数排序、桶排序)
Global and Chinese market of collaborative applications 2022-2028: Research Report on technology, participants, trends, market size and share
[eight sorts ②] select sort (select sort, heap sort)
[IVX junior engineer training course 10 papers] 04 canvas and a group photo of IVX and me
Global and Chinese markets for freight and logistics 2022-2028: Research Report on technology, participants, trends, market size and share
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
DTL dephossite | prediction method of dephosphorylation sites based on Transfer Learning