当前位置:网站首页>【深度学习】全连接网络
【深度学习】全连接网络
2022-07-26 14:01:00 【繁星¹⁸⁹⁵】
1.全连接网络
全连接神经网络(Fully Connected Netural Network,FCN)或者叫多层感知机(Multi-Layer Perception, MLP),是一种连接方式较为简单的人工神经网络结构,属于前馈神经网络的一种,只要有输入层、隐藏层和输出层构成,并且在每个隐藏层中可以有多个神经元。MLP 网络是可以应用于几乎所有任务的多功能学习方法,包括分类、回归,甚至是无监督学习。
2.全连接是如何实现的
大家都知道全连接是输入层的每个参数都参与了输出层每个参数的计算。但具体是如何实现的呢?
总结来说:是用和输入层同样大小同样通道数的卷积来实现的。
举例来说:

- 全连接把卷积输出的二维特征图(feature map)转化成一个一维向量,也就是说:最后的两列小圆球就是两个全连接层,在最后一层卷积结束后,又进行了一次池化操作,输出了20个12x12的图像(20指最后一层的厚度),然后通过了一个全连接层变成了1x100的向量(第一个全连接层神经元的个数是100)
怎么做到的?
- 该操作其实就是用100个20x12x12的卷积核卷积出来的,对于输入的每一张特征图,都使用一个和图像大小一样的核卷积进行卷积运算,这样整幅图就变成了一个数了,如果厚度是20就是那20个核卷积完了之后相加求和。这样就能把一张图高度浓缩成一个数了。
- 但是全连接的参数实在是太多了,你想这张图里就有20个12x12x100个参数,前面随便一层卷积,假设卷积核是7*7的,厚度是64,那也才7x7x64,所以现在的趋势是尽量避免全连接,目前主流的一个方法是全局平均池化(GlobalAveragePooling)。也就是最后那一层的feature map(最后一层卷积的输出结果),直接求平均值。有多少种分类就训练多少层,这十个数字就是对应的概率。
3.全连接代码实现
import torch.nn as nn
fc1 = nn.Linear(320, 50) #输入320维,输出50维的全连接网络
参考资料:
- https://blog.csdn.net/gongliming_/article/details/89634243
边栏推荐
- 周伟:寻找非共识性投资机会,陪伴延迟满足的创始团队
- [oauth2] VIII. Configuration logic of oauth2 login -oauth2loginconfigurer and oauth2clientconfigurer
- JS get the current time, time and timestamp conversion
- Flink SQL (III) connects to the external system system and JDBC
- 数据泄漏、删除事件频发,企业应如何构建安全防线?
- C语言_结构体指针来访问结构体数组
- Inspiration from brain: introduction to synaptic integration principle in deep neural network optimization
- MySQL's practice of SQL analysis and optimization from the index principle
- Detailed explanation of alter field of MySQL Foundation
- Pytorch学习笔记(二)神经网络的使用
猜你喜欢

See you tomorrow at the industrial session of cloud intelligence technology forum!

基于机器学习的技术术语识别研究综述

Why does WPS refuse advertising?

Sequence traversal of binary tree (implemented in C language)

Basic syntax of MySQL DDL and DML and DQL

敏捷开发与DevOps的对比

Force deduction ----- the number of words in the string

Tianyi cloud web application firewall (edge cloud version) supports the detection and interception of Apache spark shell command injection vulnerabilities

力扣------字符串中的单词数

php使用sqlserver
随机推荐
JSON data returned by controller
Technology sharing | gtid that needs to be configured carefully_ mode
LCL three-phase PWM rectifier (inverter)
Flink SQL (III) connects to the external system system and JDBC
[mathematical modeling] summary of common basic models
Comparison between agile development and Devops
Uncover the secret of white hat: 100 billion black products on the Internet scare musk away
421. 数组中两个数的最大异或值
天翼云Web应用防火墙(边缘云版)支持检测和拦截Apache Spark shell命令注入漏洞
Unicorn, valued at $1.5 billion, was suddenly laid off, and another track was cold?
2022-07-26日报:Alphafold DB数据库建立一周年,官推盘点亮点研究
The difference between V-model and.Sync modifier
Force deduction ----- the number of words in the string
二叉树的层序遍历(C语言实现)
Tdsql-c serverless: help start-ups achieve cost reduction and efficiency increase
力扣------字符串中的单词数
JS timer realizes the countdown and jumps to the login page
How can red star Macalline design cloud upgrade the traditional home furnishing industry in ten minutes to produce film and television level interior design effects
Basic knowledge about memory chips
gdb常用命令