当前位置:网站首页>过拟合与正则化
过拟合与正则化
2022-07-05 05:27:00 【李峻枫】
过拟合
这是一个神经网络训练过程中,经常会遇到的问题,简单来说,就是模型的表现了,学习能力太强了,以至于把训练集的所有细节都记录下来了。当遇到测试集,就是之前完全没有见过的数据的时候,就会出现明显的错误。
产生原因
最本质的一个原因就是:参数过多(模型过于复杂)
其他原因就是:
- 测试集与训练集的分布不一样
- 训练集的数量太少
解决办法
针对上述原因,可以提出几种对策
- 降低模型复杂度,常用的有正则化。
- 增强训练集
范数Norm(Minkowski距离)
定义
范数是一个函数,其赋予某个向量空间中的每个向量一长度或大小。
对于零向量,其长度为0。
∥ x ∥ p = ( ∑ i = 1 n ∣ x ∣ p ) 1 p \lVert x \rVert_p = \left(\displaystyle\sum_{i=1}^n \lvert x\rvert^p\right)^{\frac{1}{p}} ∥x∥p=(i=1∑n∣x∣p)p1
范数的性质
- 非负性 ∥ x ∥ ≥ 0 \lVert x\rVert \ge 0 ∥x∥≥0
- 齐次性 ∥ c x ∥ = ∣ c ∣ ∥ x ∥ \lVert cx\rVert=\lvert c\rvert \lVert x\rVert ∥cx∥=∣c∣∥x∥
- 三角不等式 ∥ x + y ∥ ≤ ∥ x ∥ + ∥ y ∥ \lVert x + y\rVert \leq \lVert x\rVert +\Vert y\rVert ∥x+y∥≤∥x∥+∥y∥
范数特征
- L 0 L_0 L0范数:非零元素个数
- L 1 L_1 L1范数:绝对值之和
- L 2 L_2 L2范数:欧拉距离
- L ∞ L_{\infin} L∞范数:绝对值最大的元素的绝对值
正则化
目标函数加上一个范数,作为惩罚项。如果一个参数越大,它就会使范数增大,即惩罚项增大。因此在范数的作用下,不少参数都在不断变小。
参数越小,说明其在神经网络中发挥的作用越小,即对最终结果的影响越小,因此可以使得模型更加简单,而且更加具有泛化能力。
正则化也是一种优胜劣汰的思想,虽然很多参数对模型都有用,但最终只有重要的参数才能被保留下来(值较大,对结果影响大),而大部分参数都被淘汰了(值很小,对结果影响不大)。
边栏推荐
- [paper notes] multi goal reinforcement learning: challenging robotics environments and request for research
- [to be continued] [UE4 notes] L1 create and configure items
- ssh免密登录设置及使用脚本进行ssh登录并执行指令
- [sum of two numbers] 169 sum of two numbers II - enter an ordered array
- 软件测试 -- 0 序
- 每日一题-搜索二维矩阵ps二维数组的查找
- Research on the value of background repeat of background tiling
- [turn]: OSGi specification in simple terms
- kubeadm系列-00-overview
- Pointnet++ learning
猜你喜欢

Gbase database helps the development of digital finance in the Bay Area

Palindrome (csp-s-2021-palin) solution
![[turn to] MySQL operation practice (III): table connection](/img/70/20bf9b379ce58761bae9955982a158.png)
[turn to] MySQL operation practice (III): table connection

2022年上半年国家教师资格证考试

Yolov5 ajouter un mécanisme d'attention

C language Essay 1
![[to be continued] [UE4 notes] L2 interface introduction](/img/0f/268c852b691bd7459785537f201a41.jpg)
[to be continued] [UE4 notes] L2 interface introduction

Corridor and bridge distribution (csp-s-2021-t1) popular problem solution

GBase数据库助力湾区数字金融发展

Introduction to tools in TF-A
随机推荐
[to be continued] I believe that everyone has the right to choose their own way of life - written in front of the art column
A preliminary study of sdei - see the essence through transactions
Haut OJ 1221: a tired day
When will Wei Lai, who has been watched by public opinion, start to "build high-rise buildings" again?
PMP考试敏捷占比有多少?解疑
[to be continued] [UE4 notes] L1 create and configure items
xftp7与xshell7下载(官网)
[to be continued] [UE4 notes] L3 import resources and project migration
[allocation problem] 135 Distribute candy
SAP-修改系统表数据的方法
[interval problem] 435 Non overlapping interval
[merge array] 88 merge two ordered arrays
剑指 Offer 05. 替换空格
A problem and solution of recording QT memory leakage
用STM32点个灯
Solution to the palindrome string (Luogu p5041 haoi2009)
Haut OJ 2021 freshmen week II reflection summary
利用HashMap实现简单缓存
Introduction to tools in TF-A
Fragment addition failed error lookup