当前位置:网站首页>过拟合原因及解决
过拟合原因及解决
2022-06-25 10:57:00 【用户9854323】
过拟合原因及解决
过拟合:模型在训练集上效果好;在测试集上效果差。模型泛化能力弱。
1、数据量小 解决:数据增强,也就是增加训练数据样本 例如:通过一定规则扩充数据或采集更多数据
2、模型复杂度过大,造成训练误差过小 解决: 1)、在输入中加噪声: 在输入中加高斯噪声,会在输出中生成干扰项。训练时,减小误差,同时也会对噪声产生的干扰项进行惩罚,达到减小权值的平方的目的,达到与 L2 类似的效果;
2)、正则化(限制权值): 通过给损失函数引入额外信息给模型复杂性带来相应的惩罚度。 例如: L1的效果就是让w往0靠,使网络中的权重尽可能为0,也就相当于减小了网络复杂度, L1会趋向于产生少量的特征,而其他的特征都是0;
L2正则化是通过约束參数的范数使其不要太大,所以能够在一定程度上降低过拟合情况, L2会选择更多的特征,这些特征都会接近于0
L1在特征选择时候非常有用, L2就只是一种规则化而已;
3、神经元过于密集 解决:组合多个简单模型 例: 1)dropout:改动神经网路本身,模型训练时,每次随机(如 50% 概率)忽略隐层的某些节点;这样,我们相当于随机从 2^H 个模型中采样选择模型
2)Bagging:简单理解,就是分段函数的概念,用不同的模型拟合不同部分的训练集。
3)Boosting:既然训练复杂神经网络比较慢,那我们就可以只使用简单的神经网络(层数、神经元数限制等)。通过训练一系列简单的神经网络,加权平均其输出。
4、学习树过深 解决: 提前终止(early stopping):使用交叉验证或者k折交叉验证,在每次迭代后计算验证数据集的accuracy,当accuracy不再提高时,就停止训练(一般的做法是,在训练的过程中,记录到目前为止最好的validation accuracy,当连续10次Epoch(或者更多次)没达到最佳accuracy时,则可以认为accuracy不再提高了。)
为什么early stopping有用:因为我们在初始化网络的时候一般都是初始为较小的权值。训练时间越长,部分网络权值可能越大。如果我们在合适时间停止训练,就可以将网络的能力限制在一定范围内。
边栏推荐
- Complete steps for a complete Oracle uninstall
- 3 Questions par jour (3) - vérifier l'existence d'entiers et de leurs doubles
- 2022年PMP项目管理考试敏捷知识点(2)
- 龙书虎书鲸书啃不动?试试豆瓣评分9.5的猴书
- MySQL and Oracle processing CLOB and blob fields
- After reading this article, I will teach you to play with the penetration test target vulnhub - drivetingblues-7
- 垃圾回收机制
- 撸一个随机数生成器
- 性能之文件系统篇
- Sign up to open the third session of the "flying oar hacker marathon". It's been a long time
猜你喜欢

Socket communication principle

Shen Lu, China Communications Institute: police open source Protocol - ofl v1.1 Introduction and Compliance Analysis

Query method and interrupt method to realize USART communication

Detailed explanation of Android interview notes handler

Compilation of learning from Wang Shuang (1)

数据库系列:MySQL索引优化总结(综合版)

XSS attack

Explanation and use of kotlin syntax for Android

1-7snapshots and clones in VMWare

CSRF attack
随机推荐
Upload and modify the use of avatars
OODA working method
Technical practice and development trend of video conference all in one machine
GaussDB others内存比较高的场景
Daily Mathematics Series 52: February 20
Jincang KFS data centralized scenario (many to one) deployment
Gaussdb others scenarios with high memory
Flutter adds event listening | subscription
zabbix分布式系统监控
[shangyun boutique] energy saving and efficiency improvement! Accelerating the transformation of "intelligent manufacturing" in the textile industry
报名开启|飞桨黑客马拉松第三期如约而至,久等啦
Think about it
【上云精品】节能提效!加速纺织业“智造”转型
SystemVerilog(十三)-枚举数据类型
龙书虎书鲸书啃不动?试试豆瓣评分9.5的猴书
看完这篇 教你玩转渗透测试靶机Vulnhub——DriftingBlues-7
【文件包含漏洞-04】经典面试题:已知某网站仅存在本地文件包含漏洞时,如何GetShell?
Android: generic mapping analysis of gson and JSON in kotlin
Introduction to socket UDP and TCP
网络远程访问的方式使用树莓派