当前位置:网站首页>神经网络学习笔记4——自动编码器(含稀疏,堆叠)(更新中)
神经网络学习笔记4——自动编码器(含稀疏,堆叠)(更新中)
2022-07-30 09:58:00 【奥利奥好吃呀】
目录
配套讲解视频
建议配合视频阅读博文
10分钟学会自动编码器从原理到编程实现_哔哩哔哩_bilibili
10分钟学会自动编码器从原理到编程实现
1.程序和数据集
链接:https://pan.baidu.com/s/1aSNq94BJuKsiKO5gNGF29Q
提取码:6666
--来自百度网盘超级会员V5的分享
2.自动编码器
2.1自编码器原理
通过无监督学习的方式来学习一组数据中的有效编码


自编码器的目标:重新提取特征,降低维度,最小化重构错误
目标函数:使重构错误为0

简单的两层自编码器实示例

2.2代码实现
1.数据导入
D=xlsread('C:\Users\86188\Desktop\B站ppt\ae\RaisinDataset.xlsx');
data=D(:,1:7)';
label=D(:,8)';2.数据集处理
k=rand(1,900);
[m,n]=sort(k);
input_train=data(:,n(1:750));
input_test=data(:,n(751:900));
output_train=label(:,n(1:750));
output_test=label(:,n(751:900));
x = input_train;
t=ind2vec(output_train);
t=full(t)3.设置网络结构
ae1=trainAutoencoder(x,5);
features=encode(ae1,x);
softmax=trainSoftmaxLayer(features,t);
nets=stack(ae1,softmax);4.显示结果,测试网络
view(nets)
output_test
y=nets(input_test) 
5.计算准确率
for i=1:150
output_fore(i)=find(y(:,i)==max(y(:,i)));
end
right1=0;
for i=1:150
if output_fore(i) == output_test(i)
right1=right1+1;
end
end
right=right1/1503.堆叠式自编码器
对于很多数据来说,仅使用两层神经网络的自编码器还不足以获取一种好的数据表示,为了获取更好的数据表示,我们可以使用更深层的神经网络,深层神经网络作为自编码器提取的数据表示一般会更加抽象,能够更好地捕捉到数据的语义信息。
在实践中经常使用逐层堆叠的方式来训练一个深层的自编码器。称为堆叠自编码器(StackedAuto-EncoderSAE)堆叠自编码器一般可以采用逐层训练(Layer-WiseTraining)来学习网络参数
4.稀疏自编码器
4.1稀疏编码
稀疏编码的优点
(1).计算量
稀疏性带来的最大好处就是可以极大地降低计算量。
(2)可解释性
因为稀疏编码只有少数的非零元素,相当于将一个输入样本表示为少数几个相关的特征。这样我们可以更好地描述其特征,并易于理解。
(3)特征选择
稀疏性带来的另外一个好处是可以实现特征的自动选择,只选择和输入样本相关的最少特征,从而可以更好地表示输入样本,降低噪声并减轻过拟合。
4.2.稀疏自编码器
通过给自编码器中隐藏层单元z加上稀疏性限制,自编码器可以学习到数据中一些有用的结构。
目标函数

W表示自编码器中的参数
和稀疏编码一样,稀疏自编码器的优点是有很高的可解释性,并同时进行了隐式的特征选择.
结构图

边栏推荐
- 系统设计精选 | 基于FPGA的CAN总线控制器的设计(附代码)
- 唯物辩证法-条件论
- 数据库脏读、不可重复读、幻读以及对应的隔离级别
- Multi-threading scheme to ensure that a single thread opens a transaction and takes effect
- In the robot industry professionals, Mr Robot industry current situation?
- 再有人问你分布式事务,把这篇扔给他
- jmeter接口压力测试(一)
- Understanding of deadlock
- Linux内核设计与实现(十)| 页高速缓存和页回写
- spark udf 接受并处理 null值.
猜你喜欢
![idea2021+Activiti [the most complete note one (basic use)]](/img/60/55cccf257523bed2c8829361cea97c.png)
idea2021+Activiti [the most complete note one (basic use)]

Domino Server SSL Certificate Installation Guide
容器技术 -- 简单了解 Kubernetes 的对象

梅科尔工作室-看鸿蒙设备开发实战笔记四——内核开发

Security Thought Project Summary

Re16:读论文 ILDC for CJPE: Indian Legal Documents Corpus for Court Judgment Prediction and Explanation

Re18: Read the paper GCI Everything Has a Cause: Leveraging Causal Inference in Legal Text Analysis

【C和指针第七章】可变参数列表

Detailed explanation of JVM memory layout, class loading mechanism and garbage collection mechanism

Pytorch中 nn.Transformer的使用详解与Transformer的黑盒讲解
随机推荐
MySQL |子查询
梅科尔工作室-看鸿蒙设备开发实战笔记四——内核开发
Meikle Studio-Look at the actual combat notes of Hongmeng device development six-wireless networking development
学习笔记11--局部轨迹直接构造法
死锁的理解
A new generation of free open source terminal tool, so cool
大根堆的创建(视频讲解)
SST-Calib:结合语义和VO进行时空同步校准的lidar-visual外参标定方法(ITSC 2022)
Pytorch中 nn.Transformer的使用详解与Transformer的黑盒讲解
Re15: Read the paper LEVEN: A Large-Scale Chinese Legal Event Detection Dataset
STM32CubeMX configuration to generate FreeRTOS project
MySQL installation tutorial [installation version]
MySQL | Subqueries
第2章 常用安全工具
Re21:读论文 MSJudge Legal Judgment Prediction with Multi-Stage Case Representation Learning in the Real
jmeter接口压力测试(一)
Basemap和Seaborn
Meikle Studio - see the actual combat notes of Hongmeng equipment development five - drive subsystem development
Always remember: one day you will emerge from the chrysalis
Re15:读论文 LEVEN: A Large-Scale Chinese Legal Event Detection Dataset